I just reorganized my directory structure by moving a folder of source files, called stdsc
, into a new folder cog
, creating the path cog/stdsc
. Visual Studio (2010) crashed after finishing moving the files, and after restarting it, I now get c1xx : fatal error C1083: Cannot open source file: 'stdsc\stdsc.cpp': No such file or directory
for every .cpp
file that used to reside in stdsc/
, but now lies in cog/stdsc/
.
I've tried doing "Clean project" and "Rescan solution", but still it tries to compile these files in their old location. The acual files in the new location are found and compiled, but still the error persists. How can I remove these references?
C1XX is the crossover variant of the E2XX platform, replacing the Theta Premium and Lambda platforms. Vehicles built on C1XX: Two-row mid-size: 2017–present Cadillac XT5.
The compiler generates a C1083 error when it can't find a file it requires. There are many possible causes for this error. An incorrect include search path or missing or misnamed header files are the most common causes, but other file types and issues can also cause C1083.
I noticed that the .vcxproj
file was just XML, so I opened it and removed the lines which referred to the old locations. Seems to have worked without nasty side effects. I was a bit sceptical to doing this though, so if there are other solutions, I'd love to hear them.
I just had this problem too, in Visual Studio 2010.
The "Solution Explorer" has two modes, "Show All Files" and the "filter mode" or whatever it's called.
I usually work in all files mode, because there you see the files as they actually exist in the file system.
When switching back to the filter mode there were two references to the problem file. One of them was marked red and referred to the previous path. Right click it and "exclude from project" solved the problem for me.
Using Visual Studio 2012, I encountered this issue while changing the directory of some files in my solution. I found that some of my source files, which were seemingly unrelated to what I was changing, weren't being resolved properly. When I clicked on them in the Solution Explorer, they wouldn't open, again because VS was looking for them at the wrong path. I removed the files from my solution and drag-and-dropped them back into the solution from Windows Explorer. This fixed the issue. Based on the error message, it looked like the error was somehow related to the fact that VS was using a relative path to identify the source files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With