[flext] linker error when linking a library

Stefano Papetti stefano.papetti at univr.it
Sat Aug 6 11:49:58 CEST 2011


Hi Thomas,

On 06/08/2011 11.35, Thomas Grill wrote:
> There are essentially two problems, maybe unrelated to each other
>
> - a clash of the delete operator - this is usually caused by using 
> different build models for parts that are linked. In your case it 
> seems that the libraries LIBCPMT.LIB and LIBCMT.LIB don't fit to each 
> other.
ok, I'll try to figure out how to avoid this. Perhaps I just need to 
avoid using delete and new ;)
>
> - When creating library icst_chambfilt~.lib there are symbols missing 
> (e.g. void __cdecl icstdsp::cdft(int,int,float *)), which can be 
> caused by missing source code files, or again, mismatch of build 
> models, so that the binary symbols names don't match.
sure, I was leaving out some source code... now this part is ok

thanks,
S

>
>
> Am 06.08.2011 um 11:26 schrieb Stefano Papetti:
>
>> Dear Thomas,
>>
>> I'm trying to compile an external which makes use of a (non compiled) 
>> library (the .h and .cpp files are in the same directory as the 
>> external code) and I get a LNK2005 error with msvc:
>>
>>     Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
>>     Copyright (C) Microsoft Corporation.  All rights reserved.
>>
>>             "c:\Programmi\Microsoft Visual Studio
>>     10.0\VC\BIN\nmake.exe" /NOLOGO /f
>>     C:\flext_svn\buildsys\nmake-sub.mak  PLATFORM=win RTSYS=pd
>>     COMPILER=msvc  BUILDP
>>     ATH=C:\flext_svn\buildsys\ PKGINFO=package.txt BUILDCLASS=ext
>>     TARGETMODE=release
>>      TARGETTYPE=single _build_
>>             cl /c   /DNDEBUG /Ox /arch:SSE /arch:SSE2 /LD /EHsc /GR
>>     /Oi /nologo /D_C
>>     RT_SECURE_NO_DEPRECATE /DWIN32 /D_WINDOWS /MT  /DFLEXT_SYS=2 /DPD
>>     /D_WIN32_WINNT
>>     =0x500  /I"C:\_pd_"\src /I"C:\_pd_"\src
>>     /I"C:\_pd_"\flext\source\lockfree /I"C:\
>>     _pd_"\flext .\test_ICST_DSP_flext.cpp
>>     /Fopd-msvc\release-single\main.obj
>>     main.cpp
>>             cl /c   /DNDEBUG /Ox /arch:SSE /arch:SSE2 /LD /EHsc /GR
>>     /Oi /nologo /D_C
>>     RT_SECURE_NO_DEPRECATE /DWIN32 /D_WINDOWS /MT  /DFLEXT_SYS=2 /DPD
>>     /D_WIN32_WINNT
>>     =0x500  /I"C:\_pd_"\src /I"C:\_pd_"\src
>>     /I"C:\_pd_"\flext\source\lockfree /I"C:\
>>     _pd_"\flext .\BlkDsp.cpp /Fopd-msvc\release-single\BlkDsp.obj
>>     BlkDsp.cpp
>>             cl /c   /DNDEBUG /Ox /arch:SSE /arch:SSE2 /LD /EHsc /GR
>>     /Oi /nologo /D_C
>>     RT_SECURE_NO_DEPRECATE /DWIN32 /D_WINDOWS /MT  /DFLEXT_SYS=2 /DPD
>>     /D_WIN32_WINNT
>>     =0x500  /I"C:\_pd_"\src /I"C:\_pd_"\src
>>     /I"C:\_pd_"\flext\source\lockfree /I"C:\
>>     _pd_"\flext .\AudioSynth.cpp /Fopd-msvc\release-single\AudioSynth.obj
>>     AudioSynth.cpp
>>             link /DLL  /nologo /INCREMENTAL:NO 
>>     /LIBPATH:"C:\_pd_"\bin /LIBPATH:"C:\
>>     _pd_"\bin /LIBPATH:"C:\_pd_"\flext main.obj  BlkDsp.obj AudioSynt
>>     h.obj  pd.lib LIBCPMT.LIB LIBCMT.LIB flext-pd_s.lib
>>     /out:icst_chambfilt~.dll
>>     flext-pd_s.lib(flext.obj) : error LNK2005: "void __cdecl operator
>>     delete[](void
>>     *)" (??_V at YAXPAX@Z) already defined in LIBCMT.LIB(delete2.obj)
>>     flext-pd_s.lib(fldsp.obj) : error LNK2005: "void * __cdecl
>>     operator new[](unsign
>>     ed int)" (??_U at YAPAXI@Z) already defined in LIBCPMT.LIB(newaop.obj)
>>     flext-pd_s.lib(fldsp.obj) : error LNK2005: "void __cdecl operator
>>     delete[](void
>>     *)" (??_V at YAXPAX@Z) already defined in LIBCMT.LIB(delete2.obj)
>>     flext-pd_s.lib(flxlet.obj) : error LNK2005: "void * __cdecl
>>     operator new[](unsig
>>     ned int)" (??_U at YAPAXI@Z) already defined in LIBCPMT.LIB(newaop.obj)
>>     flext-pd_s.lib(flxlet.obj) : error LNK2005: "void __cdecl
>>     operator delete[](void
>>      *)" (??_V at YAXPAX@Z) already defined in LIBCMT.LIB(delete2.obj)
>>     flext-pd_s.lib(fllib.obj) : error LNK2005: "void * __cdecl
>>     operator new[](unsign
>>     ed int)" (??_U at YAPAXI@Z) already defined in LIBCPMT.LIB(newaop.obj)
>>     flext-pd_s.lib(flmeth.obj) : error LNK2005: "void * __cdecl
>>     operator new[](unsig
>>     ned int)" (??_U at YAPAXI@Z) already defined in LIBCPMT.LIB(newaop.obj)
>>     flext-pd_s.lib(flmeth.obj) : error LNK2005: "void __cdecl
>>     operator delete[](void
>>      *)" (??_V at YAXPAX@Z) already defined in LIBCMT.LIB(delete2.obj)
>>     flext-pd_s.lib(flout.obj) : error LNK2005: "void * __cdecl
>>     operator new[](unsign
>>     ed int)" (??_U at YAPAXI@Z) already defined in LIBCPMT.LIB(newaop.obj)
>>     flext-pd_s.lib(flitem.obj) : error LNK2005: "void * __cdecl
>>     operator new[](unsig
>>     ned int)" (??_U at YAPAXI@Z) already defined in LIBCPMT.LIB(newaop.obj)
>>     flext-pd_s.lib(flitem.obj) : error LNK2005: "void __cdecl
>>     operator delete[](void
>>      *)" (??_V at YAXPAX@Z) already defined in LIBCMT.LIB(delete2.obj)
>>     flext-pd_s.lib(flqueue.obj) : error LNK2005: "void * __cdecl
>>     operator new[](unsi
>>     gned int)" (??_U at YAPAXI@Z) already defined in LIBCPMT.LIB(newaop.obj)
>>     flext-pd_s.lib(flqueue.obj) : error LNK2005: "void __cdecl
>>     operator delete[](voi
>>     d *)" (??_V at YAXPAX@Z) already defined in LIBCMT.LIB(delete2.obj)
>>     flext-pd_s.lib(flatom.obj) : error LNK2005: "void * __cdecl
>>     operator new[](unsig
>>     ned int)" (??_U at YAPAXI@Z) already defined in LIBCPMT.LIB(newaop.obj)
>>     flext-pd_s.lib(flatom.obj) : error LNK2005: "void __cdecl
>>     operator delete[](void
>>      *)" (??_V at YAXPAX@Z) already defined in LIBCMT.LIB(delete2.obj)
>>        Creating library icst_chambfilt~.lib and object
>>     icst_chambfilt~.exp
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::cd
>>     ft(int,int,float *)" (?cdft at icstdsp@@YAXHHPAM at Z) referenced in
>>     function "public:
>>      static void __cdecl icstdsp::BlkDsp::fft(float *,int)"
>>     (?fft at BlkDsp@icstdsp@@SA
>>     XPAMH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::cd
>>     ft(int,int,double *)" (?cdft at icstdsp@@YAXHHPAN at Z) referenced in
>>     function "public
>>     : static void __cdecl icstdsp::BlkDsp::fft(double *,int)"
>>     (?fft at BlkDsp@icstdsp@@
>>     SAXPANH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::rd
>>     ft(int,int,double *)" (?rdft at icstdsp@@YAXHHPAN at Z) referenced in
>>     function "public
>>     : static void __cdecl icstdsp::BlkDsp::realfft(double *,int)"
>>     (?realfft at BlkDsp@i
>>     cstdsp@@SAXPANH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::df
>>     ct(int,double *)" (?dfct at icstdsp@@YAXHPAN at Z) referenced in
>>     function "public: sta
>>     tic void __cdecl icstdsp::BlkDsp::realsymfft(double *,int)"
>>     (?realsymfft at BlkDsp@
>>     icstdsp@@SAXPANH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::dd
>>     ct(int,int,float *)" (?ddct at icstdsp@@YAXHHPAM at Z) referenced in
>>     function "public:
>>      static void __cdecl icstdsp::BlkDsp::dct(float *,int)"
>>     (?dct at BlkDsp@icstdsp@@SA
>>     XPAMH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::dd
>>     ct(int,int,double *)" (?ddct at icstdsp@@YAXHHPAN at Z) referenced in
>>     function "public
>>     : static void __cdecl icstdsp::BlkDsp::dct(double *,int)"
>>     (?dct at BlkDsp@icstdsp@@
>>     SAXPANH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::dd
>>     st(int,int,float *)" (?ddst at icstdsp@@YAXHHPAM at Z) referenced in
>>     function "public:
>>      static void __cdecl icstdsp::BlkDsp::dst(float *,int)"
>>     (?dst at BlkDsp@icstdsp@@SA
>>     XPAMH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::dd
>>     st(int,int,double *)" (?ddst at icstdsp@@YAXHHPAN at Z) referenced in
>>     function "public
>>     : static void __cdecl icstdsp::BlkDsp::dst(double *,int)"
>>     (?dst at BlkDsp@icstdsp@@
>>     SAXPANH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "public:
>>     static float __c
>>     decl icstdsp::SpecMath::rbeta(float,float,float)"
>>     (?rbeta at SpecMath@icstdsp@@SAMM
>>     MM at Z) referenced in function "public: static float __cdecl
>>     icstdsp::BlkDsp::grub
>>     bs(float *,int,int *,float *)"
>>     (?grubbs at BlkDsp@icstdsp@@SAMPAMHPAH0 at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "public:
>>     static float __c
>>     decl icstdsp::SpecMath::rgamma(float,float)"
>>     (?rgamma at SpecMath@icstdsp@@SAMMM at Z)
>>      referenced in function "public: static float __cdecl
>>     icstdsp::BlkDsp::ftest(flo
>>     at,int,float,int,bool)" (?ftest at BlkDsp@icstdsp@@SAMMHMH_N at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "public:
>>     static float __c
>>     decl icstdsp::SpecMath::erfcf(float)"
>>     (?erfcf at SpecMath@icstdsp@@SAMM at Z) referenc
>>     ed in function "public: static float __cdecl
>>     icstdsp::BlkDsp::cdfn(float,float,f
>>     loat)" (?cdfn at BlkDsp@icstdsp@@SAMMMM at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "public:
>>     static float __c
>>     decl icstdsp::SpecMath::probit(float)"
>>     (?probit at SpecMath@icstdsp@@SAMM at Z) refere
>>     nced in function "public: static class icstdsp::cpx __cdecl
>>     icstdsp::BlkDsp::civ
>>     n(float,float,float)" (?civn at BlkDsp@icstdsp@@SA?AVcpx at 2@MMM at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::rd
>>     ft(int,int,float *)" (?rdft at icstdsp@@YAXHHPAM at Z) referenced in
>>     function "public:
>>      static void __cdecl icstdsp::BlkDsp::realfft(float *,int)"
>>     (?realfft at BlkDsp@ics
>>     tdsp@@SAXPAMH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "void
>>     __cdecl icstdsp::df
>>     ct(int,float *)" (?dfct at icstdsp@@YAXHPAM at Z) referenced in
>>     function "public: stat
>>     ic void __cdecl icstdsp::BlkDsp::realsymfft(float *,int)"
>>     (?realsymfft at BlkDsp@ic
>>     stdsp@@SAXPAMH at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "public:
>>     static void __cd
>>     ecl icstdsp::SpecMath::diffpoly(float *,int)"
>>     (?diffpoly at SpecMath@icstdsp@@SAXPA
>>     MH at Z) referenced in function "public: static void __cdecl
>>     icstdsp::BlkDsp::gdels
>>     (float *,float *,int,float *,int,float *,int)"
>>     (?gdels at BlkDsp@icstdsp@@SAXPAM0H0
>>     H0H at Z)
>>     BlkDsp.obj : error LNK2019: unresolved external symbol "public:
>>     static void __cd
>>     ecl icstdsp::SpecMath::scalepoly(float *,float,int)"
>>     (?scalepoly at SpecMath@icstds
>>     p@@SAXPAMMH at Z) referenced in function "public: static void
>>     __cdecl icstdsp::BlkD
>>     sp::polyfit(float *,int,int,float *,float *,float *)"
>>     (?polyfit at BlkDsp@icstdsp@@
>>     SAXPAMHH000 at Z)
>>     icst_chambfilt~.dll : fatal error LNK1120: 16 unresolved externals
>>     NMAKE : fatal error U1077: '"c:\Programmi\Microsoft Visual Studio
>>     10.0\VC\BIN\li
>>     nk.EXE"' : return code '0x460'
>>     Stop.
>>     NMAKE : fatal error U1077: '"c:\Programmi\Microsoft Visual Studio
>>     10.0\VC\BIN\nm
>>     ake.exe"' : return code '0x2'
>>     Stop.
>>
>> Would it be different if linking a .lib? Is there a quick way to link 
>> a .lib other than STK and SndObj using flext build system?
>>
>> Best,
>> Stefano
>>
>> _______________________________________________
>> http://grrrr.org/ext/flext
>>
>> flext mailing list
>> flext at grrrr.org
>> http://grrrr.org/cgi-bin/mailman/listinfo/flext
>
> --
> Thomas Grill
> http://grrrr.org
> +43 699 19715543
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://grrrr.org/pipermail/flext/attachments/20110806/f205e32f/attachment-0001.htm>


More information about the flext mailing list