473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

LNK2005

Hi,

i have got a linker problem, i don't know how to handle; there are
three projects in my workspace. In the Project called modules_common is
a class called Features. In the second project there's a class called
FeaturesFromPng, which contains an instance of Features. The third
project contains the main-function in which i want to work with an
instance of FeaturesFromPng, but generating the instance produces a
LNK2005 error. If i delete the line which generates the instance of
Features in the class FeaturesFromPng, theres no linking problem, but
my code doesn't do what i want it to do.

Heres a part of the error-output with some verbose-information:
Durchsuchen von D:\Visual Studio
..NET\Vc7\PlatformSDK\lib\odbc32.lib:
Durchsuchen von D:\Visual Studio
..NET\Vc7\PlatformSDK\lib\odbccp32.lib:
Durchsuchen von
\user\bosse\dev\Adaptation\Features\Release\Featur es.lib:
Durchsuchen von \user\bosse\dev\Adaptation\release\Adaptation.lib:
Durchsuchen von D:\Visual Studio .NET\Vc7\lib\libcpmt.lib:
Durchsuchen von D:\Visual Studio .NET\Vc7\lib\LIBCMT.lib:
Durchsuchen von D:\Visual Studio .NET\Vc7\lib\OLDNAMES.lib:
Durchsuchen von D:\Visual Studio .NET\SDK\v1.1\lib\MSCOREE.LIB:
Durchsuchen von D:\Visual Studio .NET\Vc7\lib\msvcrt.lib:
msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info const &)"
(??0type_info@@AAE@ABV0@@Z) bereits in LIBCMT.lib(typinfo.obj)
definiert
msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info &
__thiscall type_info::operator=(class type_info const &)"
(??4type_info@@AAEAAV0@ABV0@@Z) bereits in LIBCMT.lib(typinfo.obj)
definiert
msvcrt.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall
bad_cast::bad_cast(char const *)" (??0bad_cast@@QAE@PBD@Z) bereits in
LIBCMT.lib(stdexcpt.obj) definiert
Durchsuchen von D:\Visual Studio .NET\Vc7\lib\msvcprt.lib:
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) bereits in
libcpmt.lib(xmutex.obj) definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) bereits in
libcpmt.lib(xmutex.obj) definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::locale::facet::_Register(void)"
(?_Register@facet@locale@std@@QAEXXZ) bereits in
libcpmt.lib(locale0.obj) definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::locale::facet::_Incref(void)" (?_Incref@facet@locale@std@@QAEXXZ)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: static unsigned int
__cdecl std::ctype<char>::_Getcat(class std::locale::facet const * *)"
(?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@@Z ) bereits in
batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class
std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned
int)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z) bereits in
libcpmt.lib(locale0.obj) definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) bereits in
libcpmt.lib(xlock.obj) definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) bereits in
libcpmt.lib(xlock.obj) definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::~basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(void)"
(??1?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@XZ)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > & __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::operator+=(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??Y?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAEAAV01@ABV01@@Z)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@ABV01@@Z)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(char const *)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@PBD@Z)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(unsigned int,char)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@ID@Z)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > & __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::operator+=(char
const *)"
(??Y?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAEAAV01@PBD@Z)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > & __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::operator+=(char)"
(??Y?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAEAAV01@D@Z)
bereits in configuration.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "bool __cdecl
std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ)
bereits in libcpmt.lib(uncaught.obj) definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: bool __thiscall
std::basic_istream<char,struct std::char_traits<char> >::_Ipfx(bool)"
(?_Ipfx@?$basic_istream@DU?$char_traits@D@std@@@st d@@QAE_N_N@Z) bereits
in configuration.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class
std::basic_ostream<char,struct std::char_traits<char> > & __thiscall
std::basic_ostream<char,struct std::char_traits<char> >::flush(void)"
(?flush@?$basic_ostream@DU?$char_traits@D@std@@@st d@@QAEAAV12@XZ)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)"
(?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@st d@@QAEXXZ) bereits in
batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: void __thiscall
std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z)
bereits in libcpmt.lib(ios.obj) definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall
std::basic_streambuf<char,struct std::char_traits<char>
::snextc(void)" (?snextc@?$basic_streambuf@DU?$char_traits@D@std@@ @std@@QAEHXZ) bereits in configuration.obj definiert msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > & __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::append(unsigned
int,char)"
(?append@?$basic_string@DU?$char_traits@D@std@@V?$ allocator@D@2@@std@@QAEAAV12@ID@Z)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::sgetc(void)"
(?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@ std@@QAEHXZ) bereits
in configuration.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: unsigned int
__thiscall std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::max_size(void)const "
(?max_size@?$basic_string@DU?$char_traits@D@std@@V ?$allocator@D@2@@std@@QBEIXZ)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > & __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::erase(unsigned
int,unsigned int)"
(?erase@?$basic_string@DU?$char_traits@D@std@@V?$a llocator@D@2@@std@@QAEAAV12@II@Z)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::locale::~locale(void)" (??1locale@std@@QAE@XZ) bereits in
batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::locale
__thiscall std::ios_base::getloc(void)const "
(?getloc@ios_base@std@@QBE?AVlocale@2@XZ) bereits in
batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall
std::basic_streambuf<char,struct std::char_traits<char>::sbumpc(void)" (?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@ @std@@QAEHXZ) bereits in configuration.obj definiert

msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: int __thiscall
std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)"
(?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@ std@@QAEHD@Z) bereits
in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: char __thiscall
std::basic_ios<char,struct std::char_traits<char> >::widen(char)const "
(?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@Q BEDD@Z) bereits in
batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "bool __cdecl
std::operator==<char,struct std::char_traits<char>,class
std::allocator<char> >(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,char const
*)"
(??$?8DU?$char_traits@D@std@@V?$allocator@D@1@@std @@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$ allocator@D@2@@0@PBD@Z)
bereits in batchClassifier.obj definiert
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(void)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$alloc ator@D@2@@std@@QAE@XZ)
bereits in batchClassifier.obj definiert
Thanks and regards,

Sebastian

May 29 '06 #1
2 2377
Hi Bosse,

make sure that all projects you link together use the CRT in a consistent
way. Often, the best approach is to compile everything with /MD.

Marcus Heege
May 29 '06 #2
Hi Marcus,

thanks for your reply. I compiled everthing with /MD (before I compiled
with /MT), but I've got the same error-message.

Sebastian Bosse
Marcus Heege schrieb:

Jun 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Florian Liefers | last post by:
"Hello World\n", i have the following problem: One of my headerfiles for a lib is including <vector>. When i compile the lib, everything is done well. In my application another file is...
1
by: arkam | last post by:
Hi, Here are my link errors : atlsd.lib(ATLComTime.obj) : error LNK2005: "public: __thiscall ATL::COleDateTime::COleDateTime(struct tagVARIANT const &)"...
0
by: Mike Cheel | last post by:
I keep getting that infernal LNK2005 error when I try to build my program. I am using VS.NET 2003. Here is the error: pm error LNK2005: "public: void __clrcall...
0
by: Taran | last post by:
Hi all, I have this config.h file which has all the declarations for the vars being used in the application. There are no compilation errors but link errors for all the vars declared in this...
1
by: sethuganesh | last post by:
HI, i have ported vc++ 6.0 code to visual studio 2005. During batch build in debug mode i din't get any error.But if i build the same in release mode i am getting the following error. ...
1
nabh4u
by: nabh4u | last post by:
hi, i am getting a link error in my program which states that some variable which i declared in my header file is already defined in the object file. The error is like this: error LNK2005:...
1
by: dewi | last post by:
Dear All, I am trying to compile a C code using Visual C++. Can anyone explain how to solve it? Thank You. #include <math.h> #include <string.h> #include "RV2AJFRONT_NEW.h" #include...
9
by: dewi | last post by:
Dear All, I have several problem about VC++. I succeed to convert Simulink MATLAB to C code using Real-Time Workshop. I am trying to compile a C code using Visual C++ and found the error. Can...
1
by: patelcm22 | last post by:
Hi, I am facing following errors while building my application. Error 4 fatal error LNK1169: one or more multiply defined symbols found C:\Documents and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.