Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Frazzuld

DX7 source example wont work DDEx1

This topic is 6775 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 tried to open and compile this source and I get 3 errors, all with the same line of code: LPDIRECTDRAW7 g_pDD = NULL; // DirectDraw object here are the errors: C:\mssdk\samples\Multimedia\DDraw\src\DDex1\ddex1.cpp(39) : error C2146: syntax error : missing '';'' before identifier ''g_pDD'' C:\mssdk\samples\Multimedia\DDraw\src\DDex1\ddex1.cpp(39) : error C2501: ''LPDIRECTDRAW7'' : missing storage-class or type specifiers C:\mssdk\samples\Multimedia\DDraw\src\DDex1\ddex1.cpp(39) : fatal error C1004: unexpected end of file found now this is source right out of the DX7 SDK... I am using VC++ 6.0, so I dont understand what the heck is going on here... MS cant even write compilable code with their own junk?!

Share this post


Link to post
Share on other sites
Advertisement
Try including the mssdk folder as an area where header files are stored. Visual C++ thinks that the headers are in the Program Files directory, and is not finding the ddraw.h in it.

Share this post


Link to post
Share on other sites
Junk? What''s up with people blaming the tools when they make a mistake?

Just check your include paths. You''re obviously getting past the "include < ddraw.h >" line (well, I assume that instruction is there), but LPDIRECTDRAW7 isn''t recognized. The compiler looks for the first "ddraw.h" in the include path, and stops searching. If it finds a header for DX5, DX7 stuff (like LPDIRECTDRAW7) won''t be defined.

Put the DX7 SDK in the include path before the default headers, and I bet all will be well.

Jesse Chounard
stinkygoop@crosswinds.net

Share this post


Link to post
Share on other sites
How did I make a mistake when it is THEIR source, THEIR headers, THEIR workspace, and THEIR SDK i am using? I didnt alter any of it... this is an example straight out of the SDK... SO GET OFF MY BACK!!! hehe, j/k

I put the SDK directory at the top of the list and it COMPILES fine, but when I go to build it is when I get the errors





Edited by - Frazzuld on 4/5/00 8:31:28 PM

Share this post


Link to post
Share on other sites
Okay, I did what I was told and here are the errors I am getting now... I have not modified this code in anyway

ddex1.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16
ddex1.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7
.\Debug/ddex1.exe : fatal error LNK1120: 2 unresolved externals

Share this post


Link to post
Share on other sites
You also have to include the lib files with the source.

Under project menu, then settings
choose the link tab and then add ddraw.lib and dxguid.lib to all the other lib''s listed there.

Share this post


Link to post
Share on other sites
FUH... man. You''re a genius Nytegard (and whoever else). I wrote a post about this about 2 hrs ago. I come up here and read yours and there is my solution. Thanks man... you seriously saved my butt. =)

thank you thank you.
-shpook

Share this post


Link to post
Share on other sites
Okay, I reinstalled EVERYTHING. I checked my paths under Tools/Options and the SDK directory is the first on the list. I checked the Projects/Settings and the ddraw.lib and dxguid.lib were included. It still gives me that second set of errors. Now what?

Share this post


Link to post
Share on other sites
Okay, I found it... under Tools/Options I wasnt including the LIB path, jsut the Include path... thanks for the help guys

Share this post


Link to post
Share on other sites
Now do you see that it WAS your mistake and not MS or VC? I''ll admit it is not an obvious mistake, and I believe that Visual C++ install would benifit from NOT installing ANY DirectX SDK by default, so that when you did install a DirectX SDK they would make sure and walk you through the setup procedure.
They go to all this trouble to create userfriendly little WIZARDS, and then they forget that people REALLY need configuration/setup wizards the most. And a guide that would explain the parts of the "hello world" generated code would really help newbies.

Better luck next time.

Share this post


Link to post
Share on other sites

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