Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reorganized source, c1xx C1083

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?

like image 342
carlpett Avatar asked Jul 11 '11 14:07

carlpett


People also ask

What is C1XX?

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.

What is fatal error C1083?

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.


3 Answers

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.

like image 131
carlpett Avatar answered Nov 27 '22 03:11

carlpett


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.

like image 22
luddet Avatar answered Nov 27 '22 01:11

luddet


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.

like image 22
wonderlr Avatar answered Nov 27 '22 02:11

wonderlr