Jump to content
  • Advertisement

Archived

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

Slider38

Linking trouble

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

Hi Folks, I''m new to Windows programming and having some linking difficulty. I''m currently using msvc++. I''ve created a header file and 2 source files (trying to break this code up). The header includes my defines and includes as well as some global variables. I''ve set it up with an ifndef statement before the defines and includes using an endif before the global section starts. Each of the source files contains an include "header.h" statement so that each can see the global variables. Both source files compile fine, but I''m getting 68 linking errors such as these: KWIntroduction.obj : error LNK2005: _GUID_YAxis already defined in Knight Wars Main.obj KWIntroduction.obj : error LNK2005: _GUID_XAxis already defined in Knight Wars Main.obj KWIntroduction.obj : error LNK2005: _IID_IDirectInputEffect already defined in Knight Wars Main.obj KWIntroduction.obj : error LNK2005: _IID_IDirectInputDevice8W already defined in Knight Wars Main.obj I''m not sure how to correct this. Any thoughts would be appreciated. Thanks, Slider

Share this post


Link to post
Share on other sites
Advertisement
I''m going to guess that you''ve defined INIT_GUID in your source files or in a header that includes the Direct X headers. If so, either remove all the INIT_GUID #defines and link against dxguid.lib, or make sure INIT_GUID is defined once in exactly one source file before you include the header.

Share this post


Link to post
Share on other sites
Thanks very much for the tip. I think that''s exactly what''s happened. The Init_guid is included in the header file along with ddraw and dinput includes. Thanks very much for the assistance. I''m not sure I''d have ever figured out what was causing my linking errors. Now maybe I can get this put together correctly. Slider

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!