Link to home
Start Free TrialLog in
Avatar of TheIronDuke
TheIronDuke

asked on

New installation of Visual Studio 2015 will not compile anything

I have been using VS 2008, and have installed VS 2015 side by side on the same computer. I have projects compiled in VS 20015 from another computer that compile just fine. But when I open those projects and try to compile them in the new VS 2015 on this computer they will not compile. In fact, even creating the simplest "Hello world" application will not compile.

I get errors on standard VS header files. For example, it throws errors and warnings on Windows.h like:

Warning      C4067      unexpected tokens following preprocessor directive - expected a newline      windows.h            

Error      C2061      syntax error: identifier 'LPCSTR'      
Error      C2061      syntax error: identifier 'BYTE'      

I can't figure out why this is happening. Anyone have an idea?
Avatar of Sam Simon Nasser
Sam Simon Nasser
Flag of Palestine, State of image

you need to put
#include <windows.h>

Open in new window

in the top of the source file, do you have it?

also, run these commands, what are the output of them?
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>set INCLUDE
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>set LIB
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>set LIBPATH

Open in new window

Avatar of TheIronDuke
TheIronDuke

ASKER

Yes, I do have #include <windows.h> at the top of the source file. In fact it is throwing errors on the Windows.h file like C4067 above.

I'm not sure what you mean by "running" those commands.

If you mean on the projects property pages

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC

 is already set as the defaults on the VC++ Directories page for Include directories, Library Directories.
ASKER CERTIFIED SOLUTION
Avatar of ambience
ambience
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes I double checked it. The project uses SDK 8.1, on both computers. I reinstalled 8.1 on this computer just to be sure. It is all there.

The problem seems to be centered on windows.h not recognizing the standard data types, like LPWSTR, etc. The compiler throws error on windows.h itself, and any other file that uses those data type saying they are "unidentified":

Error      C2061      syntax error: identifier 'BYTE'

This simply does not make sense to me. I tried running the VS 2015 installer again, selecting "Repair". No change.
My Mistake ambience. A corrupt Windows SDK 8.1 was the problem. Running great now. Thanks.