0

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 cpps 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?

Taitai
  • 584
  • 2
  • 7
  • 18
  • Maybe related: https://stackoverflow.com/questions/8018131/visual-studio-and-maximum-length-of-the-path-of-a-project-reference#8018295 and https://stackoverflow.com/questions/1880321/why-does-the-260-character-path-length-limit-exist-in-windows – TobiMcNamobi Oct 30 '18 at 09:38
  • If it is really the length of the path to `xxx..xx.cpp` that matters, I'd like to know how long exactly that path is allowed to be. – TobiMcNamobi Oct 30 '18 at 09:41

0 Answers0