DirectDraw...

Started by
3 comments, last by bakery2k1 18 years ago
Hey, Having a problem with DirectDraw (Im using DX9.0), In a book I have it says to type this code to get a direct draw object: LPDIRECTDRAW lpdd; DirectDrawCreate(NULL, &lpdd, NULL); lpdd->Release(); lpdd7 = NULL; But doesn't work. Its probably me doing something horribly wrong..probably...Anyway I get these error messages when trying to compile with Dev-cpp 4.9.9.2: [Linker error] undefined reference to `DirectDrawCreate@12' ld returned 1 exit status [Build Error] ["DirectCheck] Error 1 Also I have included the DX header "DDRAW.h" and have added the ddraw.lib library to my project linker parameters. My little window works fine if I don't have the past lines of code in the program. - Thanks
Advertisement
Where did you get ddraw.lib from? The version which comes with the SDK is for use with the Microsoft compilers and will not, AFAIK, work with Dev-Cpp.
In the book it tells you to include the DDRAW.LIB import library...But I guess that I should just use MS VC++ 6...
I guess the problem is that you've not added the correct libraries, dxguid.lib and ddraw.lib. also there is an easier way to intialize directdraw...

IDirectDraw7* lpdd;
DirectDrawCreateEx(0, (void**)&lpdd, IID_IDirectDraw7, 0);
-----------------------------Language: C++API: Win32, DirectXCompiler: VC++ 2003
Quote:The version which comes with the SDK is for use with the Microsoft compilers and will not, AFAIK, work with Dev-Cpp.


Having done a bit more research, I'm now not sure whether these libraries are compatible or not. Does anyone know?

This tutorial shows you how to generate a (another?) correct set of library files for use with Dev-CPP.

Quote:
I guess the problem is that you've not added the correct libraries, dxguid.lib and ddraw.lib. also there is an easier way to intialize directdraw...


The OP's code should not need dxguid.lib (yet), although your code does, and yours is the method I would recommend.

This topic is closed to new replies.

Advertisement