Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open source file: 'WIN32': No such file or directory

Getting this error building a C++ project in VS2008. Very confused what it means, why does it think WIN32 is a file?

like image 823
Mr. Boy Avatar asked Dec 07 '10 10:12

Mr. Boy


2 Answers

Go to Project-->Properties-->C/C++-->Command line. You most probably have a /I"" before your /D "WIN32". For some reason an empty include directive causes the /D to evaporate hence your error.

Go to Project-->Properties-->C/C++-->General-->Additional include directories and make sure there are no redundant chars there.

It can for example arise when the last include directory is a reference to an environement variable that doesn't exist.

like image 174
hillel Avatar answered Nov 18 '22 08:11

hillel


the /I "" is most likely caused by undefined environment variables, e.g. If you have /I $(BOOSTROOT), then you will get /I "" and it will eat the next token '/D' and leaving WIN32 as a file

like image 2
michael song Avatar answered Nov 18 '22 09:11

michael song