I copied a project to some new location. But for "..\"
the relative path is not changing. Then I tried to build the project with my visual studio 2015.
cxx1: c1083 error cannot open source file"..\test\xxxxxxxxxxxxxxxxxx.cpp"
First of all, in the same directory that contains xxxxxxxxxxxxxxxxxx.cpp
, all other cpp
s all have been successfully compiled except 'xxxxxxxxxxxxxxxxxx.cpp'
. This is quite strange.
I removed this 'xxxxxxxxxxxxxxxxxx.cpp'
from the project. Then readded, but still did not work.
However if I copied 'xxxxxxxxxxxxxxxxxx.cpp'
to e.g. user\Documents
, and then added it again to the project. It worked.
Thus I guess this must have something to do with the length of my source code name and its path. ('xxxxxxxxxxxxxxxxxx.cpp'
surely has a long name and the directory is very deep).
And secondly, if I use notepad++ to open myproject.vcxproj
, the 'xxxxxxxxxxxxxxxxxx.cpp'
appeared quite far behind in the compiling sequence, e.g.<ClCompile Include=
, in the original directory. If I copied it to user\Documents
, it's location will be raised forward.
So any explanation for such a phenomenon? And any suggestions to make it work without copying 'xxxxxxxxxxxxxxxxxx.cpp'
to a different directory?