Jump to content
  • Advertisement

Archived

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

bobthebobert

Visual C++ and DirectX , beginner help needed

This topic is 5196 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 am trying (Emphasize trying) to get DirectX to work with microsoft''s Visual C++. However, even basic tutorials get errors and do not work. So far I have downloaded DX SDK 9.0, and have included in the Visual C++ Tools->>Options->>Directories, for include directorys: C:\ dx sdk\include, and for the library directorys: C:\dx sdk\lib I am not sure if this is the problem or not, but it also gives this error when I try to compile it: Output Window Compiling... WinMain.cpp c:\c++ programs\tut\cdirectdrawgame.h(40) : error C2146: syntax error : missing '';'' before identifier ''m_lpdd7'' c:\c++ programs\tut\cdirectdrawgame.h(40) : error C2501: ''LPDIRECTDRAW7'' : missing storage-class or type specifiers c:\c++ programs\tut\cdirectdrawgame.h(40) : error C2501: ''m_lpdd7'' : missing storage-class or type specifiers c:\c++ programs\tut\cdirectdrawgame.h(41) : error C2146: syntax error : missing '';'' before identifier ''m_lpdds_primary'' c:\c++ programs\tut\cdirectdrawgame.h(41) : error C2501: ''LPDIRECTDRAWSURFACE7'' : missing storage-class or type specifiers c:\c++ programs\tut\cdirectdrawgame.h(41) : error C2501: ''m_lpdds_primary'' : missing storage-class or type specifiers c:\c++ programs\tut\cdirectdrawgame.h(42) : error C2146: syntax error : missing '';'' before identifier ''m_lpdds_back'' c:\c++ programs\tut\cdirectdrawgame.h(42) : error C2501: ''LPDIRECTDRAWSURFACE7'' : missing storage-class or type specifiers c:\c++ programs\tut\cdirectdrawgame.h(42) : error C2501: ''m_lpdds_back'' : missing storage-class or type specifiers c:\c++ programs\tut\cdirectdrawgame.h(45) : error C2146: syntax error : missing '';'' before identifier ''m_lpdi8'' c:\c++ programs\tut\cdirectdrawgame.h(45) : error C2501: ''LPDIRECTINPUT8'' : missing storage-class or type specifiers c:\c++ programs\tut\cdirectdrawgame.h(45) : error C2501: ''m_lpdi8'' : missing storage-class or type specifiers c:\c++ programs\tut\cdirectdrawgame.h(46) : error C2146: syntax error : missing '';'' before identifier ''m_di_keyboard'' c:\c++ programs\tut\cdirectdrawgame.h(46) : error C2501: ''LPDIRECTINPUTDEVICE8'' : missing storage-class or type specifiers c:\c++ programs\tut\cdirectdrawgame.h(46) : error C2501: ''m_di_keyboard'' : missing storage-class or type specifiers

Share this post


Link to post
Share on other sites
Advertisement
When you added the directories for the includes and libraries, did you add them at the top of their lists, before any other directories? This is very important, otherwise the compiler will pick up earlier versions of the directx headers that shipped with visual studio.

Alan

Share this post


Link to post
Share on other sites
Ok, I think I have an idea where I am going wrong now.

http://www.cplusplus.com/src/ and then scroll down and click on the Basic Direct 3D. Download it, and then extract it. That''s what I did, then I assumed to make it work you would just double click on the "WinMain.cpp", and then build it like that?

Share this post


Link to post
Share on other sites
you also need to add the libs you're using to the linker's command line.

if you're using...

... VC++ 6 go to project\settings\Link and add dxguid.lib d3d9.lib ddraw.lib dinput8.lib and whatever else you might be using to Object/library modules.

... VC++ .NET go to project\properties\Linker\Command Line and add the same as above in the additional options.

and finally, you got some syntax errors. dont forget the ;

hope this helps
VRAM Strider.

[edited by - VStrider on June 6, 2004 11:17:50 PM]

Share this post


Link to post
Share on other sites
Set Directory Enviroment to DirectX SDK, so that if it still error you must change LPDIRECTDRAW7 to LPDIRECTDRAW and etc...

Share this post


Link to post
Share on other sites
Set Directory Enviroment to DirectX SDK, so that if it still error you must change LPDIRECTDRAW7 to LPDIRECTDRAW and etc...

Share this post


Link to post
Share on other sites
Thanks for the help guys, but I figured out what I was doing wrong. When I opened the tutorial I was clicking on the source code instead of the "Project", which kinda screwed everything up. Thanks for your help though

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Is it possible to download Direct 3D, or does it only come with video cards/computer add-ons?
(I need it to play the FF7 demo on my comp...)

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!