[Insight-users] Undefined reference

Maximilien Renard iixamaxii at gmail.com
Thu Apr 2 06:17:58 EDT 2009


Thank you Bill !

Sadly, these errors are still left :

Running build steps for project project...
Creating gdb macros library...
Starting: C:/Qt/4.4.1/bin/qmake.exe
F:/Documents/cpp/CTScannerAnalysis-1.0/project.pro -spec win32-g++ -r
CONFIG+=debug_and_release
Exited with code 0.
Starting: C:/MinGW/bin/mingw32-make.exe release -w
mingw32-make: Entering directory `F:/Documents/cpp/CTScannerAnalysis-1.0'
C:/MinGW/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `F:/Documents/cpp/CTScannerAnalysis-1.0'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl
-Wl,-subsystem,windows -o release\project.exe
object_script.project.Release  -L"c:\Qt\4.4.1\lib" -lopengl32 -lglu32
-lgdi32 -luser32 -lmingw32 -lqtmain
-LC:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/
-LC:/librairies/mITK-mingw/Lib/ -lITKFEM -lITKBasicFilters
-lITKNumerics -lITKIO -lITKNrrdIO -litkgdcm -litkjpeg12 -litkjpeg16
-litkopenjpeg -litkpng -litktiff -litkjpeg8 -lITKSpatialObject
-lITKMetaIO -lITKDICOMParser -lITKEXPAT -lITKniftiio -lITKznz
-litkzlib -lITKCommon -litkvnl_inst -litkvnl_algo -litkv3p_netlib
-litkvnl -litkvcl -litksys -lmitk_dll -lQtOpenGL4 -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `F:/Documents/cpp/CTScannerAnalysis-1.0'
mingw32-make: Leaving directory `F:/Documents/cpp/CTScannerAnalysis-1.0'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x2085):
undefined reference to `WSAStartup at 8'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x2365):
undefined reference to `SnmpUtilOidCpy at 8'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x23ba):
undefined reference to `SnmpUtilOidCpy at 8'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x23d8):
undefined reference to `SnmpUtilOidCpy at 8'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x2448):
undefined reference to `SnmpUtilOidNCmp at 12'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x24a4):
undefined reference to `SnmpUtilOidNCmp at 12'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x2603):
undefined reference to `SnmpUtilVarBindFree at 4'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x2617):
undefined reference to `SnmpUtilVarBindFree at 4'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x2d8f):
undefined reference to `UuidCreate at 4'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x3a9a):
undefined reference to `WSAStartup at 8'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x3ab5):
undefined reference to `WSACleanup at 0'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x3b73):
undefined reference to `gethostname at 8'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x3b97):
undefined reference to `gethostbyname at 4'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libitkgdcm.a(gdcmUtil.obj):gdcmUtil.cxx:(.text+0x3d28):
undefined reference to `WSACleanup at 0'
C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit//libITKCommon.a(itkWin32OutputWindow.obj):itkWin32OutputWindow.cxx:(.text+0x67a):
undefined reference to `GetStockObject at 4'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\project.exe] Error 1
mingw32-make: *** [release] Error 2
Exited with code 2.
Error while building project project
When executing build step 'Make'

What could be the problem ?

Thanks a lot,

Regards,

Maximilien Renard

2009/4/1 Bill Lorensen <bill.lorensen at gmail.com>:
> I left out the system libs. Here is my link line:
> -lgdi32 ../../bin/libITKFEM.a ../../bin/libITKBasicFilters.a
> ../../bin/libITKNumerics.a ../../bin/libITKIO.a
> ../../bin/libITKNrrdIO.a ../../bin/libitkgdcm.a
> ../../bin/libitkjpeg12.a ../../bin/libitkjpeg16.a
> ../../bin/libitkopenjpeg.a -lsnmpapi -lrpcrt4 ../../bin/libitkpng.a
> ../../bin/libitktiff.a ../../bin/libitkjpeg8.a
> ../../bin/libITKSpatialObject.a ../../bin/libITKMetaIO.a -lcomctl32
> -lwsock32 ../../bin/libITKDICOMParser.a ../../bin/libITKEXPAT.a
> ../../bin/libITKniftiio.a ../../bin/libITKznz.a ../../bin/libitkzlib.a
> ../../bin/libITKCommon.a ../../bin/libitkvnl_inst.a
> ../../bin/libitkvnl_algo.a ../../bin/libitkv3p_netlib.a
> ../../bin/libitkvnl.a ../../bin/libitkvcl.a ../../bin/libitksys.a
> -lgdi32 -lws2_32
>
> On Tue, Mar 31, 2009 at 10:17 PM, Maximilien Renard <iixamaxii at gmail.com> wrote:
>> Hi Bill,
>>
>> Although I don't understand why it worked (isn't libITKFEM.a supposed
>> to depend on ITKBasicsFilter and ITKIO ?), your solution reduced the
>> number of undefined references a lot!
>>
>> Still, there are some left, the first ones are due to mitk (but how
>> can I have such an error since there is only a Mitk_dll.lib ?) but the
>> last ones are ITK.
>>
>> Thank you already a lot,
>>
>> Best regards,
>>
>> Maximilien
>>
>> P.S. See error.txt for the current errors
>>
>> 2009/3/31 Bill Lorensen <bill.lorensen at gmail.com>:
>>> Here is the order of the libs for my (cmake-generated) mingw build:
>>> libITKFEM.a
>>> libITKBasicFilters.a
>>> libITKNumerics.a
>>> libITKIO.a
>>> libITKNrrdIO.a
>>> libitkgdcm.a
>>> libitkjpeg12.a
>>> libitkjpeg16.a
>>> libitkopenjpeg.a
>>> libitkpng.a
>>> libitktiff.a
>>> libitkjpeg8.a
>>> libITKSpatialObject.a
>>> libITKMetaIO.a
>>> libITKDICOMParser.a
>>> libITKEXPAT.a
>>> libITKniftiio.a
>>> libITKznz.a
>>> libitkzlib.a
>>> libITKCommon.a
>>> libitkvnl_inst.a
>>> libitkvnl_algo.a
>>> libitkv3p_netlib.a
>>> libitkvnl.a
>>> libitkvcl.a
>>> libitksys.a
>>>
>>>
>>> On Tue, Mar 31, 2009 at 2:11 PM, Maximilien Renard <iixamaxii at gmail.com> wrote:
>>>> Hi Luis,
>>>>
>>>> Wow this is what I call active people, got two messages to tell me
>>>> that I've forgot it ;) I've just sent another message with the
>>>> attached file but it seems too big and I have to wait for a moderator
>>>> to approve it.
>>>>
>>>> But here's a quote of the said error.txt :
>>>>
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text+0xc80):
>>>> undefined reference to
>>>> `itkdicomparser::DICOMAppHelper::GetImageData(void*&,
>>>> itkdicomparser::DICOMParser::VRTypes&, unsigned long&)'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text+0xcaa):
>>>> undefined reference to `itkdicomparser::DICOMAppHelper::Clear()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text+0xda8):
>>>> undefined reference to
>>>> `itkdicomparser::DICOMParser::ClearAllDICOMTagCallbacks()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text+0xe3d):
>>>> undefined reference to
>>>> `itkdicomparser::DICOMParser::OpenFile(std::string const&)'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text+0xf34):
>>>> undefined reference to `itkdicomparser::DICOMParser::ReadHeader()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text+0x11fe):
>>>> undefined reference to
>>>> `itkdicomparser::DICOMAppHelper::RescaledImageDataIsSigned()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text+0x1212):
>>>> undefined reference to
>>>> `itkdicomparser::DICOMAppHelper::RescaledImageDataIsFloat()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text+0x14cc):
>>>> undefined reference to `itkdicomparser::DICOMAppHelper::Clear()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text$_ZN14itkdicomparser11DICOMParser11IsDICOMFileEv[itkdicomparser::DICOMParser::IsDICOMFile()]+0x28):
>>>> undefined reference to
>>>> `itkdicomparser::DICOMParser::IsDICOMFile(itkdicomparser::DICOMSource&)'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text$_ZN3itk14MetaDataObjectINS_5ArrayIfEEEC1Ev[itk::MetaDataObject<itk::Array<float>
>>>>>::MetaDataObject()]+0x43): undefined reference to
>>>> `itk::MetaDataObjectBase::MetaDataObjectBase()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text$_ZN3itk14MetaDataObjectINS_5ArrayIfEEEC1Ev[itk::MetaDataObject<itk::Array<float>
>>>>>::MetaDataObject()]+0x84): undefined reference to
>>>> `itk::MetaDataObjectBase::~MetaDataObjectBase()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.rdata$_ZTVN3itk13DICOMImageIO2E[vtable
>>>> for itk::DICOMImageIO2]+0x60): undefined reference to
>>>> `itk::LightProcessObject::UpdateOutputData()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text$_ZN3itk14MetaDataObjectINS_5ArrayIfEEED1Ev[itk::MetaDataObject<itk::Array<float>
>>>>>::~MetaDataObject()]+0x72): undefined reference to
>>>> `itk::MetaDataObjectBase::~MetaDataObjectBase()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text$_ZN3itk14MetaDataObjectINS_5ArrayIfEEED1Ev[itk::MetaDataObject<itk::Array<float>
>>>>>::~MetaDataObject()]+0x9c): undefined reference to
>>>> `itk::MetaDataObjectBase::~MetaDataObjectBase()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text$_ZN3itk14MetaDataObjectINS_5ArrayIfEEED0Ev[itk::MetaDataObject<itk::Array<float>
>>>>>::~MetaDataObject()]+0x72): undefined reference to
>>>> `itk::MetaDataObjectBase::~MetaDataObjectBase()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text$_ZN3itk14MetaDataObjectINS_5ArrayIfEEED0Ev[itk::MetaDataObject<itk::Array<float>
>>>>>::~MetaDataObject()]+0x9c): undefined reference to
>>>> `itk::MetaDataObjectBase::~MetaDataObjectBase()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkDICOMImageIO2.obj):itkDICOMImageIO2.cxx:(.text$_ZNK3itk14MetaDataObjectINS_5ArrayIfEEE5PrintERSo[itk::MetaDataObject<itk::Array<float>
>>>>>::Print(std::basic_ostream<char, std::char_traits<char> >&)
>>>> const]+0x14): undefined reference to
>>>> `itk::MetaDataObjectBase::Print(std::ostream&) const'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkBMPImageIO.obj):itkBMPImageIO.cxx:(.rdata$_ZTVN3itk10BMPImageIOE[vtable
>>>> for itk::BMPImageIO]+0x60): undefined reference to
>>>> `itk::LightProcessObject::UpdateOutputData()'
>>>> C:/librairies/InsightToolkit-3.8.0/bin/lib/InsightToolkit/libITKIO.a(itkBioRadImageIO.obj):itkBioRadImageIO.cxx:(.rdata$_ZTVN3itk13BioRadImageIOE[vtable
>>>> for itk::BioRadImageIO]+0x60): undefined reference to
>>>> `itk::LightProcessObject::UpdateOutputData()'
>>>> collect2: ld returned 1 exit status
>>>> mingw32-make[1]: *** [release\project.exe] Error 1
>>>> mingw32-make: *** [release] Error 2
>>>> Exited with code 2.
>>>> Error while building project project
>>>> When executing build step 'Make'
>>>>
>>>> Thanks a lot !
>>>>
>>>> Maximilien
>>>>
>>>> 2009/3/31 Luis Ibanez <luis.ibanez at kitware.com>:
>>>>> Hi Maximilien,
>>>>>
>>>>> I appears that you may have forgotten the attachment.
>>>>>
>>>>> Could you please resend ?
>>>>>
>>>>>    Thanks
>>>>>
>>>>>
>>>>>         Luis
>>>>>
>>>>>
>>>>> -----------------------------------------------------------
>>>>> On Tue, Mar 31, 2009 at 4:59 PM, Maximilien Renard <iixamaxii at gmail.com> wrote:
>>>>>> Hi there,
>>>>>>
>>>>>> I'm having some trouble : I've written a program using Qt and ITK.
>>>>>> I've first compiled it under linux and had no problem. Now I'm trying
>>>>>> to compile it under windows. I'm not using CMake (I've just used it to
>>>>>> compile ITK from sources). The libs have been included that way (part
>>>>>> of my .pro) :
>>>>>>
>>>>>>    LIBS += -L$${ITK_LIB_PATH} \
>>>>>>        $${ITK_LIB_PATH}libITKDICOMParser.a \
>>>>>>        $${ITK_LIB_PATH}libITKEXPAT.a \
>>>>>>        $${ITK_LIB_PATH}libitkvcl.a \
>>>>>>        $${ITK_LIB_PATH}libitktestlib.a \
>>>>>>        $${ITK_LIB_PATH}libitkvnl.a \
>>>>>>        $${ITK_LIB_PATH}libitkv3p_netlib.a \
>>>>>>        $${ITK_LIB_PATH}libitkvnl_algo.a \
>>>>>>        $${ITK_LIB_PATH}libitkvnl_inst.a \
>>>>>>        $${ITK_LIB_PATH}libitksys.a \
>>>>>>        $${ITK_LIB_PATH}libITKCommon.a \
>>>>>>        $${ITK_LIB_PATH}libITKStatistics.a \
>>>>>>        $${ITK_LIB_PATH}libITKNumerics.a \
>>>>>>        $${ITK_LIB_PATH}libITKAlgorithms.a \
>>>>>>        $${ITK_LIB_PATH}libITKBasicFilters.a \
>>>>>>        $${ITK_LIB_PATH}libitkzlib.a \
>>>>>>        $${ITK_LIB_PATH}libitkjpeg12.a \
>>>>>>        $${ITK_LIB_PATH}libitkjpeg16.a \
>>>>>>        $${ITK_LIB_PATH}libitkjpeg8.a \
>>>>>>        $${ITK_LIB_PATH}libitkopenjpeg.a \
>>>>>>        $${ITK_LIB_PATH}libitkgdcm.a \
>>>>>>        $${ITK_LIB_PATH}libitkpng.a \
>>>>>>        $${ITK_LIB_PATH}libitktiff.a \
>>>>>>        $${ITK_LIB_PATH}libITKMetaIO.a \
>>>>>>        $${ITK_LIB_PATH}libITKSpatialObject.a \
>>>>>>        $${ITK_LIB_PATH}libITKznz.a \
>>>>>>        $${ITK_LIB_PATH}libITKniftiio.a \
>>>>>>        $${ITK_LIB_PATH}libITKNrrdIO.a \
>>>>>>        $${ITK_LIB_PATH}libITKIO.a \
>>>>>>        $${ITK_LIB_PATH}libITKFEM.a \
>>>>>>        $${MITK_LIB_PATH}Mitk_dll.lib
>>>>>>
>>>>>> I've checked the order using the ITKLibraryDepends.cmake and I think
>>>>>> it's OK. Sadly this is the output when I try compile my project (see
>>>>>> Attached File error.txt).
>>>>>>
>>>>>> Do you have any idea on how I could fix that ? This is a school
>>>>>> project and I've been trying for days to fix that but nothing helps.
>>>>>>
>>>>>> Any help would be appreciated !
>>>>>>
>>>>>> Thanks a lot,
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Maximilien Renard
>>>>>> _____________________________________
>>>>>> Powered by www.kitware.com
>>>>>>
>>>>>> Visit other Kitware open-source projects at
>>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>>
>>>>>> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>>>>>>
>>>>>> Follow this link to subscribe/unsubscribe:
>>>>>> http://www.itk.org/mailman/listinfo/insight-users
>>>>>>
>>>>>
>>>> _____________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.itk.org/mailman/listinfo/insight-users
>>>>
>>>
>>
>


More information about the Insight-users mailing list