Sign in to follow this  
ilflyer12

Already Defined Errors in Visual Studio 2003

Recommended Posts

ilflyer12    122
Alright everyone, i am trying to finish up a program that needs to do major matrix operations. However, currently when i include the clapack.lib, i get the following errors:
leafPRT error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCD.lib(typinfo.obj)
leafPRT error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCD.lib(typinfo.obj)
leafPRT error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
leafPRT error LNK2005: _fprintf already defined in LIBCD.lib(fprintf.obj)
leafPRT error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
leafPRT error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
I know they are called by the clapack.lib because if i remove the lapack code and remove the library file, the program runs fine with no errors. Does anyone know how to get rid of these errors? I have made sure that when i compile the clapack library from the source that it is done with Single-threaded debugging just like my actual project. I appreciate all the help.

Share this post


Link to post
Share on other sites
Red Ant    471
Do you use UNICODE (or multibyte characters) in both projects as well? Because if one is compiled as UNICODE when the other is compiled as multibyte-character then you'll get the same linker errors IIRC.

P.S. No, forget it, that's nonsense. Little brainfart here. :o

Share this post


Link to post
Share on other sites
Sneftel    1788
Most likely, you're building clapack.lib with one runtime (Multithreaded DLL, Debug Singlethreaded, etc.), and your host app with another.

EDIT: Hmm, nevermind.

Share this post


Link to post
Share on other sites
ilflyer12    122
Ok, so all of my builds were Unicode but since the solution had about 25 projects in it, when i changed the one that I was using to Single Threaded Debug, i had not changed the rest. After going through each one and changing all of them to Single Threaded Debug, I no longer get the already defined error. Thanks everyone for your help since you did help me solve it even if it wasnt on purpose :-)

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