[CMake] Linking error with VS2005

John Drescher drescherjm at gmail.com
Fri May 21 10:26:59 EDT 2010


On Fri, May 21, 2010 at 10:17 AM, Daanen Vincent <daanen at koelis.com> wrote:
> Hello,
>
>> Can you post the exact error.
> I would say that these errors are the well-known linker errors about libcmt
> and msvcrt
> msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
> type_info::type_info(class type_info const &)" (??0type_info@@AAE at ABV0@@Z)
> déjà défini(e) dans libcmtd.lib(typinfo.obj)
> msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: class type_info &
> __thiscall type_info::operator=(class type_info const &)"
> (??4type_info@@AAEAAV0 at ABV0@@Z) déjà défini(e) dans libcmtd.lib(typinfo.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _sprintf déjà défini(e) dans
> libcmtd.lib(sprintf.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _tolower déjà défini(e) dans
> libcmtd.lib(tolower.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _printf déjà défini(e) dans
> libcmtd.lib(printf.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _malloc déjà défini(e) dans
> libcmtd.lib(dbgheap.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _realloc déjà défini(e) dans
> libcmtd.lib(dbgheap.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _free déjà défini(e) dans
> libcmtd.lib(dbgheap.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _fprintf déjà défini(e) dans
> libcmtd.lib(fprintf.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _fclose déjà défini(e) dans
> libcmtd.lib(fclose.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _floor déjà défini(e) dans
> libcmtd.lib(floor_pentium4.obj)
> msvcrtd.lib(MSVCR80D.dll) : error LNK2005: _fopen déjà défini(e) dans
> libcmtd.lib(fopen.obj)
>
>> Are all libraries in your project (including itk) compiled by the same
> compiler version?
> Yes, all my libs and application are built with VS2005 compiler
>
> V
>
>
>> -----Message d'origine-----
>> De : John Drescher [mailto:drescherjm at gmail.com]
>> Envoyé : vendredi 21 mai 2010 14:29
>> À : Daanen Vincent
>> Cc : cmake at cmake.org
>> Objet : Re: [CMake] Linking error with VS2005
>>
>> On Fri, May 21, 2010 at 8:01 AM, Daanen Vincent
>> <daanen at koelis.com> wrote:
>> > Dear Cmake users,
>> >
>> > I'm facing to a problem I can't resolve.
>> > I'm developping on a windows XP SP3 box with Visual Studio 2005.
>> >
>> > I have a project using itk which compile fine.
>> > For  some reason, I try to use cmake to generate the "same"
>> project and I
>> > got linker error (conflict between msvcrtd.lib and libcmtd.lib)
>> >
>> > - I check that the librairies are declared in the same
>> order in both project
>> > and it's ok
>> > - Try to ignore either msvcrtd.lib or libcmtd.lib but I
>> does not work :
>> > other linker errors appear.
>> >
>> > I could not find what is specifically added by cmake so that the
>> > "cmake-generated" project fails to build the binray whereas the
>> > "manually-generated" project file succeeds...
>> >
>> > Is there someone who could help me ?
>> >
>>
>> Can you post the exact error. Are all libraries in your project
>> (including itk) compiled by the same compiler version?
>>
>> John
>
>



-- 
John M. Drescher


More information about the CMake mailing list