Sign in to follow this  
lXciD

linking problem because of conflicting object

Recommended Posts

lXciD    122
Hi, I was tasked to integrate a server into a client so as to create a p2p architecture. The problem is when i had the library added to the client and compile. i face with linking problem. for example. error LNK2005: "public: __thiscall World::World(void)" (??0World@@QAE@XZ) already defined in world.obj what you you all suggest i do? i had little experience in doing this kind of porting.

Share this post


Link to post
Share on other sites
Ashkan    451
I suspect World::World(void) is supposed to be an inline function and is therefore declared inside a header file but the programmer who has written that code has somehow forgotten to put the inline keyword before the definition of the function so each compilation unit that includes this header file gets its own copy of the function which results in the aforementioned linker error.

It's a wild shot in the dark though. In case this doesn't work, you need to provide more info and/or probably some source codes.

HTH

Share this post


Link to post
Share on other sites
Kylotan    9973
Another hypothesis is that you're including the same source file in 2 places within the project. You'd need to factor shared code out into a 3rd place so it's only built once.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this