Important: Please read the Qt Code of Conduct -

Undefined reference

  • Hi,
    I am trying to integrate 3rdparty library into QT but it shows following error,

    16:50:55: Running steps for project MyQtApp...
    16:50:55: Configuration unchanged, skipping qmake step.
    16:50:55: Starting: "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe"
    C:\Qt\5.6\mingw49_32\bin\qmake.exe -spec win32-g++ -o Makefile
    C:/Qt/Tools/mingw492_32/bin/mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory 'G:/Official/MRI/DICOM/dev/DcmtkQtLink'
    g++ -Wl,-s -Wl,-subsystem,console -mthreads -o bin\release\MyQtApp.exe release/main.o -LG:\Official\MRI\DICOM\dev\DcmtkQtLink\thirdparty\dcmtk\lib -ldcmdata -ldcmimage -ldcmimgle -ldcmjpeg -ldcmjpls -loflog -lofstd -LC:\Qt\5.6\mingw49_32\lib C:\Qt\5.6\mingw49_32\lib\libQt5Core.a
    release/main.o:main.cpp:(.text.startup+0x265): undefined reference to _imp___ZN13DcmFileFormatC1Ev' release/main.o:main.cpp:(.text.startup+0x29b): undefined reference to_imp___ZN10OFFilenameC1EPKcb'
    C:/Qt/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: release/main.o: bad reloc address 0x29b in section `.text.startup'
    collect2.exe: error: ld returned 1 exit status
    Makefile.Release:61: recipe for target 'bin\release\MyQtApp.exe' failed
    mingw32-make[1]: Leaving directory 'G:/Official/MRI/DICOM/dev/DcmtkQtLink'
    makefile:34: recipe for target 'release' failed
    mingw32-make[1]: *** [bin\release\MyQtApp.exe] Error 1
    mingw32-make: *** [release] Error 2
    16:50:58: The process "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project MyQtApp (kit: Desktop Qt 5.6.1 MinGW 32bit2)
    When executing step "Make"
    16:50:58: Elapsed time: 00:03.

    Please help me to solve the issue

  • Lifetime Qt Champion

    @Binu-Janardhanan said:

    3rdparty library

    Hi and welcome
    If this 3rdparty library is a DLL, then it must ALSO be compiled with mingw492_32.
    You cannot link dlls compiled with one compiler to another compiler.
    You will have to rebuild the DLL with your compiler. (mingw)

    Often supplied DLLS are for a version of visual studio.

    So please check if the DLLS are indeed for mingw :)

  • Thanks your response. I will try to sort out the issue from your thread

Log in to reply