Jump to content
  • Advertisement
Sign in to follow this  
Kryptus

Problem unknown

This topic is 4907 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 can't seem to figure out what I'm doing wrong with my code. The link to the code is http://www.users.bigpond.com/jackorang/my problem.zip . It is the start of a small game I was going to make to see what I could do with DirectX but it compiles with an error I'm not familiar with. Could you guys please download it and try it out and report to me a solution? Thanks. Below is the output window when I compile: Output Window Compiling... Main.cpp Skipping... (no relevant changes detected) SWEngine.cpp Linking... SWEngine.obj : error LNK2005: "struct IDirect3DDevice9 * g_pD3DDevice" (?g_pD3DDevice@@3PAUIDirect3DDevice9@@A) already defined in Main.obj SWEngine.obj : error LNK2005: "struct IDirect3D9 * g_pD3D" (?g_pD3D@@3PAUIDirect3D9@@A) already defined in Main.obj Debug/School Wars.exe : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. [Edited by - Kryptus on March 16, 2005 5:51:58 AM]

Share this post


Link to post
Share on other sites
Advertisement
For starters, you could tell us the exact error message.

*starts psychic troubleshooting*
Are you linking to the proper libraries?
Do you have the DX9 SDK installed and configured?
Have your cat been eating proper lately?

Edit: Oh, you edited it in...

I would move the globals from the School Wars.h header to your SWEngine.cpp and put an extern declaration of them in the header like this:
extern LPDIRECT3DDEVICE9 g_pD3DDevice;

Share this post


Link to post
Share on other sites
I am linking to the correct libraries I'm sure because I can compile other DX applications. I have a link to the header <d3d9.h> and d3d9.lib and I have properly set up the links in the Tools > Options > Directories area.

Share this post


Link to post
Share on other sites
Hey thanks that worked well! But if I add other modules and things, will they still be able to refer to the D3D and D3DDevice objects correctly?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yeah, if you include the header file.

Share this post


Link to post
Share on other sites
But the references aren't in the header file so I can't include them. They are now in one of the source files.

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!