Sign in to follow this  
nooblet

windows.h

Recommended Posts

Okay so I'm trying to work on a mod using Source SDK and VC2005 Express. I downloaded Platform SDK and I put all the directories in under Tools > Options, and I added user32.lib to the Linker > Input, but I'm still getting this error:
fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

Share this post


Link to post
Share on other sites
#include <windows.h>

Well I got that fixed. Apparently it wasn't including the platform SDK like it should so I copied all of the include files into the VC/include folder. Now it's giving me this error:


fatal error LNK1181: cannot open input file 'winmm.lib'





EDIT AGAIN:

FIXED. I just copied the Lib folder over like I did with the include, works fine now.

Share this post


Link to post
Share on other sites
Quote:
Original post by nooblet
Well I got that fixed. Apparently it wasn't including the platform SDK like it should so I copied all of the include files into the VC/include folder. Now it's giving me this error:


You'd have been better to just add the SDK include and library folders to VS's search folders through Tools->Options->Projects and Solutions->VC Directories.

If MS ever decided to upgrade the SDK, you're going to have a hell of a time updating your installation.

As an easier alternative, if you upgrade to VS Express 2008, that installs with the Platform SDK by default and saves all this hassle. You still need to install the DXSDK though if you need DirectX, for which you need to add the include and lib directories as above.

Share this post


Link to post
Share on other sites
Quote:
Original post by Super Llama
How are you including the file?

#include "windows.h" will still generate an error even if the directory is included (I think)

#include <windows.h> will search for the file in the directories and subdirectories.




"windows.h" is fine, it's what I used. Personally i only use angled braces when including standard headers

Share this post


Link to post
Share on other sites
Quote:
"windows.h" is fine, it's what I used. Personally i only use angled braces when including standard headers
And with that statement, I urge you to learn about the difference in using quotes vs. angle brackets. It's not a stylistic difference.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Quote:
Original post by godsenddeath
i'm aware of the difference
Then your compiler is broken and non standards-compliant (I.e. VC6), or you have some very weird directory setup.


Visual Studio 08 Pro, and no weird set up, VS searches it's project paths if it can't find it in the project folder

Share this post


Link to post
Share on other sites
Quote:
Original post by godsenddeath
Visual Studio 08 Pro, and no weird set up, VS searches it's project paths if it can't find it in the project folder
Interesting, I seem to recall having problems when using quotes instead of angle brackets in VC2003 or VC2005. Do you know if this is specified in the standard?

Share this post


Link to post
Share on other sites
MSDN gives that using quotes:

This form instructs the preprocessor to look for include files in the same
directory of the file that contains the #include statement, and then in the
directories of any files that include (#include) that file. The preprocessor
then searches along the path specified by the /I compiler option, then along
paths specified by the INCLUDE environment variable.

and angle brackets:

This form instructs the preprocessor to search for include files first along the
path specified by the /I compiler option, then, when compiling from the command
line, along the path specified by the INCLUDE environment variable.

so godsenddeath's method will work fine in Visual Studio at least

EDIT:
Just tested it in VS2005 on XP and it works fine

Share this post


Link to post
Share on other sites
most likely you'd see "implementation specific" thrown in there a lot for that sort of thing, i think VS just does it to cut down on problems, i'd assume when using "", files in the project folder take precidence, whereas using angled brackets, precidence is given in the order that the project paths are stated

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this