Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Error C1083: Cannot open source file" Shouldn't Be Looking For The File At All

Tags:

c++

I was trying to #include a cpp file with some functions so I can use that cpp file later with other projects. It gave me an 'already defined in .obj' error and since then that .cpp file was like binded with my project. (I understood that's not the way, the answer here helped me with the already defined)

If I exclude the .cpp file from the project, remove it from the directory and remove the #include line it still looks for it:

c1xx : fatal error C1083: Cannot open source file: 'std.cpp': No such file or directory

Diagnostic:

Outputs for D:\MY DOCUMENTS\C#\PROJECT\D3DTESTC++\COWS AND BULLS\CBMAIN.CPP|D:\MY DOCUMENTS\C#\PROJECT\D3DTESTC++\COWS AND BULLS\STD.CPP: (TaskId:15)

It shouldn't be looking for the std.cpp at all, I removed it! So is there a way I can reset the project and recompile so that the program doesn't look for it? I already tried Rebuild and Clear -> Build Project

like image 433
Bonnev Avatar asked May 07 '13 15:05

Bonnev


People also ask

What is c1083 error in Visual Studio Code?

For people having problem related to "error C1083: Cannot open source file": Error is caused by settings in *.vcxproj file. Probably you deleted/moved source file by file explorer, not by Visual Studio's "Solution Explorer". Thus, your *.vcxproj file is corrupted.

How to fix c1083-cannot open source file?

For people having problem related to "error C1083: Cannot open source file": Error is caused by settings in *.vcxproj file. Probably you deleted/moved source file by file explorer, not by Visual Studio's "Solution Explorer". Thus, your *.vcxproj file is corrupted. Fix is to manually correct settings in *.vcxproj file.

What does C cannot open file type file mean?

Cannot open filetype file: ' file ': message 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.

How do I fix a c1083 error when adding a header file?

When the header file is not found, the compiler generates a C1083 error. The fix for this problem is to use the correct file, not to add the header file or directory to the build. When a project is configured to use precompiled headers, the relevant .pch files have to be created so that files that use the header contents can be compiled.


1 Answers

When I ran across a similar problem with VS Express, I wound up having to open up the the .vcxproj file (which is just XML), and remove the offending < ClInclude Include="FILEPATHANDNAME" > tags.

like image 130
AaronF Avatar answered Oct 20 '22 08:10

AaronF