Jump to content
  • Advertisement
Sign in to follow this  
slutbit

Get Dir. X working?

This topic is 4432 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

I dont know much programming, just the most simple commands. Im trying to follow the very first DirectX examples with ddraw.h and ddraw.lib I found in a book called "Windows Game programming for dummies" by André Lamothe. And Im really dumb so... I have taken time to install DirectX Sdk so I expected it to work from the instructions by the book. But I get a bunch of errors at a row that looks like: LPDIRECTDRAW7 lpdd; // pointer to direct draw object error C2146: syntax error : missing ';' before identifier 'lpdd' error C2501: 'LPDIRECTDRAW7' : missing storage-class or type specifiers fatal error C1004: unexpected end of file found I just downloaded and installed a version of DxSDK, and I run Visual C++ 6 on winXP. What does the compiler want from me?

Share this post


Link to post
Share on other sites
Advertisement
Quote:

error C2146: syntax error : missing ';' before identifier 'lpdd'

What happens if you change LPDIRECTDRAW7 to LPDIRECTDRAW ?
Acording to the error the compiler dont recognize LPDIRECTDRAW7.
What version of DX SDK did you install ?

Quote:

fatal error C1004: unexpected end of file found

Make sure you dont miss any brackets anywhere in the code

Share this post


Link to post
Share on other sites
I've already tried "LPDIRECTDRAW" but i get even more errors with undeclared identifiers and warnings. I dont think I have missed any brackets because this is an example from the disc that came with the book.

The version I installed is called Ms DirectX SDK (April 2006), and I just downloaded it from microsoft. It feels like my Visual C++ dosent understand that I have installed Sdk. Ive also noticed that I have to choose what user I should log in to WinXP since I installed SDK, but there is only one user to log in with.

Share this post


Link to post
Share on other sites
Without more info I have to guess...

Make sure you have

#define INITGUID
#include <ddraw.h>

somewhere at the top of the file

Share this post


Link to post
Share on other sites
Thats strange indeed.

I wrote this test and it compiled fine:

#define INITGUID
#include <ddraw.h>

int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprevinst, LPSTR cmd, int show)
{
LPDIRECTDRAW7 lpdd;
return 0;
}


I opened ddraw.h and searhed for LPDIRECTDRAW7:

...
typedef struct IDirectDraw7 FAR *LPDIRECTDRAW7;
...


Maybe you should check if you find it too

Share this post


Link to post
Share on other sites
Quote:
Original post by slutbit
ddraw.h is included

I use msvc++ 6.0.

But microsoft products have a way of never work.


Are you sure you are correctly linking to the DDraw library files as well?

Share this post


Link to post
Share on other sites
"Are you sure you are correctly linking to the DDraw library files as well?"

no, thats where I think the problem is. I was in the menu - settings - Link, and wrote ddraw.lib where theres a bunch of other .lib files. So I thought I had linked it, is there more to do?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!