Hi,
I've been trying to implement DirectInput in my wrapper. I include dinput.h , and link to dinput.lib and dxguid.lib. I'm using the Dev C++ compatible header files for DirectX 8, and it comes up with a whole host of errors:
Line 645: syntax error before `;'
Line 657: syntax error before `;'
Line 1053: syntax error before `;'
I guess it's something to do with dxguid being included wrongly.
Any ideas?
CloudNine
[edited by - CloudNine on May 22, 2003 3:27:09 PM]
I''m making my first wrapper class for direct input as well. I had some of the same problems.
First, you don''t have to link to the dxguid.lib if you put #define INITGUID at the top of your main "implementation source file". This tells the compiler to get all the wonderful com GUID''s and IID''s. (Linking to the dxguid.lib is not wrong. Just giving you an alternative)
Second, make sure you include dinput.h before you include your class files. I found that the errors your describing come about because the compiler is not "understanding" the new variables/struct/class/interface such as LPDIRECTINPUT8.
If you still have problems with it e-mail me the source and I''ll take a look. chase_encode@hotmail.com
#include "CApplication.h" //Include our CDirectApplication class #include "System.h" //Include the System functions #include "CPrimitives.h" //Include the Primitives class //================================================//
#include "CApplication.h" //Include our CDirectApplication class #include "System.h" //Include the System functions #include "CPrimitives.h" //Include the Primitives class //================================================//
What is a WRAPER = I meen is that the correct name for a small program that does what? Im not sure how to describe the WRAPER as I do not know what it is.
Sorry I write classes, exporting dll''s and trying on DX9 but im not really familar with this wraper thingy... explain.
Most APIs are very generalized description of what you can do with them. They are very powerfull but also very complex. A common use of Wrappers is to provide a simpler, more application specific interface.
The other would be to create a single interface that stays the same independant of the API used.
For example you could design a general TEXTURE wrapper, which gets implemented as a DX_TEXTURE as well as a OGL_TEXTURE. The TEXTURE class exposes methods like ''enableTextureForNextRenderCall''. The DX_TEXTURE sets its DIRECTDRAWSURFACE object to the right stage, The OGL_TEXTURE instead does that glEnable(), glBindTexture, ... stuff both for the same call.
So whoever uses the texture, i.e engine, to create a programm needs not worry about wheter OGL or DX is in use.
--------------------------- I may be getting older, but I refuse to grow up
I don't have an answer to your question but maybe something that could help you...
My code is working well without defining INITGUID before or after including dinput.h. This library is build as a DLL and I don't include anything else from DirectX or Windows in it.
BTW, I'm using GUID and I need to link the DLL with dxguid.lib.
I remember something else... On a old hard drive, the headers were chronically corrupted and I got some strange errors like your one. Then, I had to patch DX and Windows headers :/.
Anyway, I''m glad you''re not stuck anymore.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform.
You can accept analytics or continue with necessary cookies only.
Learn more