Sign in to follow this  

DirectDraw...

This topic is 4282 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

This topic is 4282 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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