Skip to main content
GameDev.net gamedev.net
🔒 Locked

Way Too Many Errors

Started by programmermattc Aug 29, 2006 at 10:48 AM 4 replies 600+ views
Original Post
programmermattc
programmermattc
I was just trying to get a basic framework layed out by following this older book and the code doesn't work (surprise, surprise). The code is giving me really wierd errors though, if I define something such as HINSTANCE hInst; it tells me I need a ';' before hInst. It's giving me 91 errors because like everyone one of my declares errors like that plus says HINSTANCE needs a variable when it's declared. Here's the source files I've included in my project d3d8.lib, d3dx8.lib, dinput.lib, and dxguid.lib although at this point I really shouldn't need any of them if I took out my #includes. Anyone have any ideas?
=============================RhinoXNA - Easily start building 2D games in XNA!Projects
ApochPiQ
ApochPiQ
HINSTANCE is a Windows-defined type. Make sure you #include windows.h if you want to use it.

I haven't checked your code, but I'd be willing to bet that will solve the bulk of your errors. In any case, it's definitely the place to start.

You mentioned that you "took out" your #includes - why? Headers aren't optional; you can only remove them if you really don't use anything they declare.


One last thought: the .libs you have set are irrelevant. C and C++ build binaries in two stages: compilation, and linking. Compilation turns the raw code into object code which is close (but not the same as) machine code. You get basically one object code file per source code file. Linking then stitches together all the object code and produces the final binary in the proper machine code. .libs are included during the linking phase.
darkelf2k5
darkelf2k5
Quote:
The code is giving me really wierd errors though, if I define something such as HINSTANCE hInst; it tells me I need a ';' before hInst. It's giving me 91 errors because like everyone one of my declares errors like that plus says HINSTANCE needs a variable when it's declared.


#include
Every time you implement a singleton, God kills a kitten. Please, think of the kittens!
programmermattc
programmermattc
I have one core header including my DirectX statements as well as my erroring .h file. The core header also has #include before the include to my erroring file. Shouldn't that work with windows.h included before including my other file?
=============================RhinoXNA - Easily start building 2D games in XNA!Projects
T_Janssen
T_Janssen
You have included the wrong header file: Core_System.h instead of Core_Global.h (which includes Core_System.h in turn)

Also, there is a small typo in one of the headers: 'Long' instead of 'long', and you are missing a definition of the windows procedure.

hope it helps,
Tom
programmermattc
programmermattc
Thanks Tom that include fixed it. The book I guess didn't add that because they wanted 'to create all these files so they would run independently.' Independently my ass lol.
=============================RhinoXNA - Easily start building 2D games in XNA!Projects

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.