QT,GDCM库问题。 “对'_imp_ZNgdcmr11ImageReader ...的未定义引用。

时间:2019-10-09 10:14:31

标签: c++ qt gdcm

我想在API QT 5.13.1(MinGW 7.3.0 64位)中使用C ++运行GDCM lib(v.3.0.0)以读取DICOM文件。当我包含头文件并查看库中的所有方法时,这是正常的。但在这儿 尝试运行时出现递增错误:

  

对'_imp__ZN4gdcm11ImageReaderC1Ev'的未定义引用

这是我已经尝试过的东西:

  1. 包括所有GDCM库

  2. 降级gpp

dcm_reader.pro文件

...
INLCUDEPATH += -L'C:\Program Files (x86)\GDCM 3.0\include\gdcm-3.0'
LIBS        += -L'C:\Program Files (x86)\GDCM 3.0\bin'
LIBS        += -L'C:\Program Files (x86)\GDCM 3.0\lib'
LIBS        += -lgdcmcharls -lgdcmCommon -lgdcmDICT -lgdcmDSED -lgdcmexpat -lgdcmIOD -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmMEXD -lgdcmMSFF -lgdcmuuid -lgdcmzlib -lsocketxx

#LIBS += -lgdcmImageReader // Raised error "cannot find -lgdcmImageReader"

main.cpp

incude <gdcmImageReader.h>

int main()
{
    gdcm::ImageReader reader; // Error: undefined reference to '_imp__ZN4gdcm11ImageReaderC1Ev'
}

我怀疑此错误是由于我没有完整版本的库或GDCM库不适合QT兼容所致。

编译输出:

18:15:25: Запускаются этапы для проекта dcm_reader... 18:15:25: Запускается: "C:\Qt\Qt5.13.1\Tools\mingw730_32\bin\mingw32-make.exe" clean -j4 C:/Qt/Qt5.13.1/Tools/mingw730_32/bin/mingw32-make -f Makefile.Debug clean C:/Qt/Qt5.13.1/Tools/mingw730_32/bin/mingw32-make
-f Makefile.Release clean mingw32-make[1]: Entering directory 'C:/Users/user/Documents/build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug' del debug\moc_predefs.h mingw32-make[1]: Entering directory 'C:/Users/user/Documents/build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug' del release\moc_predefs.h Н• г§ •вбп ≠ ©в® C:\Users\user\Documents\build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug\debug\moc_predefs.h Н• г§ •вбп ≠ ©в® C:\Users\user\Documents\build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug\release\moc_predefs.h del debug\main.o del release\main.o Н• г§ •вбп ≠ ©в® C:\Users\user\Documents\build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug\release\main.o mingw32-make[1]: Leaving directory 'C:/Users/user/Documents/build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug' mingw32-make[1]: Leaving directory 'C:/Users/user/Documents/build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug' 18:15:27: ѕроцесс ЂC:\Qt\Qt5.13.1\Tools\mingw730_32\bin\mingw32-make.exeї завершился успешно. 18:15:27: «апускаетс€: ЂC:\Qt\Qt5.13.1\5.13.1\mingw73_32\bin\qmake.exeї C:\Users\user\Documents\dcm_reader\dcm_reader.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" 18:15:28: ѕроцесс ЂC:\Qt\Qt5.13.1\5.13.1\mingw73_32\bin\qmake.exeї завершился успешно. 18:15:28: «апускаетс€: ЂC:\Qt\Qt5.13.1\Tools\mingw730_32\bin\mingw32-make.exeї -f C:/Users/user/Documents/build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug/Makefile qmake_all mingw32-make: Nothing to be done for 'qmake_all'. 18:15:28: ѕроцесс ЂC:\Qt\Qt5.13.1\Tools\mingw730_32\bin\mingw32-make.exeї завершился успешно. 18:15:28: Запускается: "C:\Qt\Qt5.13.1\Tools\mingw730_32\bin\mingw32-make.exe" -j4 C:/Qt/Qt5.13.1/Tools/mingw730_32/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory 'C:/Users/user/Documents/build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug' g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -W -Wextra
-fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_CORE_LIB -I..\dcm_reader -I. -I..\..\..\..\Qt\libs\GDCM_3.0\include\gdcm-3.0 -I..\..\..\..\Qt\Qt5.13.1\5.13.1\mingw73_32\include -I..\..\..\..\Qt\Qt5.13.1\5.13.1\mingw73_32\include\QtCore -Idebug -I..\..\..\..\Qt\Qt5.13.1\5.13.1\mingw73_32\mkspecs\win32-g++  -o debug\main.o ..\dcm_reader\main.cpp g++ -Wl,-subsystem,console
-mthreads -o debug\dcm_reader.exe debug/main.o  -LC:\Qt\libs\GDCM_3.0\bin -LC:\Qt\libs\GDCM_3.0\lib -lgdcmcharls -lgdcmCommon -lgdcmDICT -lgdcmDSED -lgdcmexpat -lgdcmgetopt -lgdcmIOD -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmmd5 -lgdcmMEXD -lgdcmMSFF -lgdcmzlib C:\Qt\Qt5.13.1\5.13.1\mingw73_32\lib\libQt5Cored.a    debug/main.o: In function `main': C:\Users\user\Documents\build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug/../dcm_reader/main.cpp:5: undefined reference to `_imp___ZN4gdcm11ImageReaderC1Ev' C:\Users\user\Documents\build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug/../dcm_reader/main.cpp:5: undefined reference to `_imp___ZN4gdcm11ImageReaderD1Ev' collect2.exe: error: ld returned 1 exit status mingw32-make[1]: *** [Makefile.Debug:65: debug/dcm_reader.exe] Error 1 mingw32-make: *** [Makefile:38: debug] Error 2 mingw32-make[1]: Leaving directory 'C:/Users/user/Documents/build-dcm_reader-Desktop_Qt_5_13_1_MinGW_32_bit-Debug' 18:15:31: ѕроцесс ЂC:\Qt\Qt5.13.1\Tools\mingw730_32\bin\mingw32-make.exeї завершился с кодом 2. Ошибка при сборке/разворачивании проекта dcm_reader (комплект: Desktop Qt 5.13.1 MinGW 32-bit) Во время выполнения этапа "Сборка" 18:15:31: ѕрошло времени: 00:05.

0 个答案:

没有答案