• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 109
  • Last Modified:

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?
0
TheIronDuke
Asked:
TheIronDuke
  • 3
1 Solution
 
Sam Simon NasserIT Support ProfessionalCommented:
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

0
 
TheIronDukeAuthor Commented:
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.
0
 
ambienceCommented:
Probably some missing SDK's like Platform SDK for Windows etc. Can you make sure the setup is identical on both machines?  Comparing the installation folders can help figure out differences.
0
 
TheIronDukeAuthor Commented:
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.
0
 
TheIronDukeAuthor Commented:
My Mistake ambience. A corrupt Windows SDK 8.1 was the problem. Running great now. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now