Skip to main content
GameDev.net gamedev.net
🔒 Locked

Linking errors :(

Started by mrhodes Dec 29, 2003 at 10:56 AM 6 replies 1.1k views
Original Post
mrhodes
mrhodes
Hey everyone... I'm having some strange linking errors that are somewhat new to me. I'm working on making a little game library, and as such I have 3 projects in one solution (VC++.NET). I'm using just plain C/C++ code, no C#. Right now my library has a couple classes in it. Everything compiles fine, but when I try to run a console program I get a bunch on linking errors. Now, I am including the library file in the console, I have the header file included as well. Here is one of the error messages I got: Console_Testing error LNK2005: __dosmaperr already defined in LIBCD.lib(dosmap.obj) All the errors are of the same nature. These errors only occur when I declare an object from my class definition. As soon as I comment that out, the errors go away. Any ideas?? Thanks very much, Michael Rhodes Tiger Studios Entertainment http://www.tigerstudios.net [edited by - mrhodes on December 29, 2003 11:56:32 AM]
Michael RhodesTiger Studios Web Designhttp://tigerstudios.net
mrhodes
mrhodes
No body knows ???

I''m literally stuck with this waiting for help

Thanks


Michael Rhodes
Tiger Studios Entertainment
http://www.tigerstudios.net
Michael RhodesTiger Studios Web Designhttp://tigerstudios.net
Mathematix
Mathematix
Have you defined the class in a header file? As a test, move your class definition into the body of your code and see if this error goes. If it does, isolate your class definitions.
mrhodes
mrhodes
In my game engine I have all my classes defined as a .h / .cpp pair. All the headers for each class are included in one main header, and the one header is included in my project...

This set up works with my Windows32bit exe project, just not the console one

I''ll keep hacking away at it...



Michael Rhodes
Tiger Studios Entertainment
http://www.tigerstudios.net
Michael RhodesTiger Studios Web Designhttp://tigerstudios.net
VolkerG
VolkerG
Do you use static libs? If so, make sure they all use the same runtime library as the DLL/EXE does.
Cedric
Cedric
dosmaperr, that''s your variable? Could you, perchance, be defining the global variable dosmaperr in a header file?
mrhodes
mrhodes
Ah, I will check the runtime library to verify that it is the same for both LIB file, and my exe. I suspect that may be the problem

Michael RhodesTiger Studios Web Designhttp://tigerstudios.net
mrhodes
mrhodes
BINGO!

My library was compiled with Multy Threaded libraries, and my exe was compiled with single threaded!

Thanks for the help guys!



Michael Rhodes
Tiger Studios Entertainment
http://www.tigerstudios.net
Michael RhodesTiger Studios Web Designhttp://tigerstudios.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.