Sign in to follow this  
TaylorGJ

DirectDraw...

Recommended Posts

TaylorGJ    122
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

Share this post


Link to post
Share on other sites
bakery2k1    712
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.

Share this post


Link to post
Share on other sites
simon10k    220
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);

Share this post


Link to post
Share on other sites
bakery2k1    712
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.

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