initializing directdraw
i get these errors...
C:\Documents and Settings\brandon\Desktop\Tetris\main.cpp(22) : error C2146: syntax error : missing '';'' before identifier ''lpdd''
C:\Documents and Settings\brandon\Desktop\Tetris\main.cpp(22) : error C2501: ''LPDIRECTDRAW'' : missing storage-class or type specifiers
C:\Documents and Settings\brandon\Desktop\Tetris\main.cpp(22) : fatal error C1004: unexpected end of file found
while using this code....
.........
int Game_Init(void *parms = NULL);
int Game_Main(void *parms = NULL);
int Game_Shutdown(void *parms = NULL);
HWND main_window_handle = NULL;
LPDIRECTDRAW lpdd;
LPDIRECTDRAW lpdd4;
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wparam,
LPARAM lparam)
{
........
if you need to see more of the code ill post in a reply, any help would much appreciated
thanks
the errors above were my stupidity, sry, but im getting another error
(204) : error C2065: ''IID_IDirectDraw4'' : undeclared identifier
ddraw.h is included
this is probably my stupidity again
(204) : error C2065: ''IID_IDirectDraw4'' : undeclared identifier
ddraw.h is included
this is probably my stupidity again
err i seem to be getting the same problem you had (the one in the first post)
How did you solve it?
How did you solve it?
I think you''re linking to the wrong libraries and #including the wrong headers. Make sure you''re using the right files, and make the directory they''re in the highest priority in your compiler. For example, MS Visual Studio already has some old directx library includes in its include directory, so you''ll have to tell it not to use those.
- JQ
Full Speed Games. Coming soon.
- JQ
Full Speed Games. Coming soon.
JonnyQuest, you were right about the library thing, and when i compile it, i get no errors but when i build it i get this:
Linking...
main.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7
Debug/Tetris.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Linking...
main.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7
Debug/Tetris.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
As far as I can tell, either you''re linking to the wrong version of DDRAW.LIB or you haven''t included it in your link section. In order for your program to compile and run successfuly you have to include the ddraw.h (which you did) AND tell the compiler to LINK the resulting .obj file to several .LIB files including DDRAW.LIB. Hope it helps!!
here is what i have for all configurations
ddraw.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib
am im doing this wrong or something
ddraw.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib
am im doing this wrong or something
Have you put a #define INITGUID before you #include "ddraw.h"? If not, there''s the problem.
The DirectX GUIDs (IIDs/CLSIDs) are declared but not defined by default. dxguid.lib contains their definitions, so you link against that and it all works fine. Alternatively you define INITGUID which makes the DX headers define all the GUIDs as constants.
The DirectX GUIDs (IIDs/CLSIDs) are declared but not defined by default. dxguid.lib contains their definitions, so you link against that and it all works fine. Alternatively you define INITGUID which makes the DX headers define all the GUIDs as constants.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement