Re: Microsoft Visual Studio .NET linking errors
- From: "Bran Kelly" <brankelly at inerworx dot com>
- Date: Mon, 9 May 2005 14:28:25 +0800
We've actually just encountered the same thing on our project. We don't yet
know the exact cause of it, but (for us) we solved the problem by
painstakingly commenting out code line by line until we found the linking
offender. It ended up being std::cout and its relatives. Once we commented
all uses of this we had no problems linking.
Now, why this happens we still don't understand. We have other stand-alone
unit tests that use std::cout with no linking problems, but when brought
back into our main project (~200KLOCs), it refuses to link, no matter what
we do.
"Gabrielle A. Grün" <grun@xxxxxxxxx> wrote in message
news:buffe.1272265$6l.313701@xxxxxxxxxxx
>
>
> Hi All,
>
> If this is the wrong newsgroup for this question, please let me know what
> is the correct newsgroup. I am using Microsoft Visual Studio NET version
> 7.1. I have persisistent linking errors with a particular project despite
> cleaning and re-creating the project from scratch. CbcCompareGrun.hpp/cpp
> and CbcModel.hpp/cpp contain no reference at all to lock or unlock.
> Thanks for helping.
>
>
>>
>> ------ Build started: Project: osiLib, Configuration: Debug Win32 ------
>>
>> osiLib - up-to-date.
>>
>>
>> ------ Build started: Project: osiClpLib, Configuration: Debug
>> Win32 ------
>>
>> osiClpLib - up-to-date.
>>
>>
>> ------ Build started: Project: coinLib, Configuration: Debug Win32 ------
>>
>> coinLib - up-to-date.
>>
>>
>> ------ Build started: Project: clpLib, Configuration: Debug Win32 ------
>>
>> clpLib - up-to-date.
>>
>>
>> ------ Build started: Project: cglLib, Configuration: Debug Win32 ------
>>
>> cglLib - up-to-date.
>>
>>
>> ------ Build started: Project: cbcSamplesSample2aa, Configuration: Debug
>> Win32 ------
>>
>> Linking...
>> LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to
>> '/INCREMENTAL:NO'
>> specification
>> libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
>> std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in
>> cbcLib.lib(CbcCompareGrun.obj)
>> libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
>> std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined
>> in
>> cbcLib.lib(CbcCompareGrun.obj)
>> libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall
>> std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in
>> cbcLib.lib(CbcCompareGrun.obj)
>> libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall
>> std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in
>> cbcLib.lib(CbcCompareGrun.obj)
>> LINK : warning LNK4098: defaultlib 'LIBCD' conflicts with use of other
>> libs;
>> use /NODEFAULTLIB:library
>>
> E:\b4\NEWCOIN\c\COIN\Win-VSNET\cbcSamplesSample2aa\Debug\cbcSamplesSample2aa.exe
>
>>
>> : fatal error LNK1169: one or more multiply defined symbols found
>>
>> Build log was saved at
>> "
>>
> file://e:\b4\Newcoin\c\Coin\Win-VSNET\cbcSamplesSample2aa\Debug\BuildLog.htm
>
>> "
>> cbcSamplesSample2aa - 5 error(s), 2 warning(s)
>>
>>
>> ---------------------- Done ----------------------
>>
>> Build: 7 succeeded, 1 failed, 0 skipped
>>
>>
>
> After paring down CbcCompareGrun.hpp/cpp, the following linking errors
> result:
>
>
> ------ Build started: Project: osiLib, Configuration: Debug Win32 ------
>
> osiLib - up-to-date.
>
>
> ------ Build started: Project: cbcLib, Configuration: Debug Win32 ------
>
> cbcLib - up-to-date.
>
>
> ------ Build started: Project: clpLib, Configuration: Debug Win32 ------
>
> clpLib - up-to-date.
>
>
> ------ Build started: Project: cglLib, Configuration: Debug Win32 ------
>
> cglLib - up-to-date.
>
>
> ------ Build started: Project: coinLib, Configuration: Debug Win32 ------
>
> coinLib - up-to-date.
>
>
> ------ Build started: Project: cbcSamplesSamples2b, Configuration: Debug
> Win32 ------
>
> Linking...
> LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to
> '/INCREMENTAL:NO' specification
> libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
> std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in
> cbcLib.lib(CbcModel.obj)
> libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
> std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined
> in cbcLib.lib(CbcModel.obj)
> LINK : warning LNK4098: defaultlib 'LIBCD' conflicts with use of other
> libs; use /NODEFAULTLIB:library
> LINK : error LNK2020: unresolved token (0A00003B) CbcCompareUser.__dtor
> LINK : fatal error LNK1120: 1 unresolved externals
>
> Build log was saved at
> "file://e:\b4\Newcoin\c\Coin\Win-VSNET\cbcSamplesSamples2b\Debug\BuildLog.htm"
> cbcSamplesSamples2b - 4 error(s), 2 warning(s)
>
>
> ---------------------- Done ----------------------
>
> Build: 7 succeeded, 1 failed, 0 skipped
>
>
>
> Gabrielle A. Grün, Ph.D. Student
> School of Computing Science
> Simon Fraser University
> 8888 University Drive
> Burnaby, BC
> V5A 1S6
> <http://www.cs.sfu.ca/~grun>
>
.
- References:
- Microsoft Visual Studio .NET linking errors
- From: Gabrielle A. Grün
- Microsoft Visual Studio .NET linking errors
- Prev by Date: LNK6028, incremental linking
- Next by Date: Re: importing vs 6 project into .net 2003
- Previous by thread: Microsoft Visual Studio .NET linking errors
- Next by thread: LNK6028, incremental linking
- Index(es):
Loading