Sign in to follow this  

Visual Studio 2003 Linker Error

Recommended Posts

Hi folks out there ! Unfortunately the search feature of this board let me down (may be my connection), so I apologize in advance for any duplicate matter I am posting. I just encountered a strange error in VS 2003 while trying to compile&link a rather large project and wondered if anyone has seen something similar. Having a relatively simple class-hierarchy (involving virtual inheritance) with some pure virtual and virtual methods in the base-class, VS7 seems to have a problem linking the whole thing when the return-types of the derived methods in the first ancenstor-classes are not *exactly* the same (the compiler is happy with it, coz all return types are covariant to the base-classes one). The linker quits with a LNK2005 and complains about having multiple definitions of the respected methods in the obj-file of the derived class. When I adjust the return types everythings linking fine. Other compilers (namely Codewarrior and gcc) link without problems. Unfortunately I was not yet able to reconstruct the situation on a smaller scale, involving just a few files so I could give you some example-code. If anybody has seen anything comparable, I'd appreciate any help! Thnx in advance, Hope I have made my point clear enough to follow, Christian P.S: /FORCE for the linker helps out, but is not the solution I am looking for. Should mention, that I am not running MFC or Managed C++, neither have I included any other library-files apart from VS7 win32-console libs [Edited by - Novative on October 17, 2004 5:15:41 PM]

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