1

我正在尝试在我的项目中使用库 gdcm。但是我遇到了一些问题。

gdcmGlobal.cxx:-1: error: undefined reference to gdcm::System::FileIsDirectory(char const*)' gdcmGlobal.cxx:-1: error: undefined reference togdcm::System::FileIsDirectory(char const*)' gdcmGlobal.cxx:-1: error: undefined reference to gdcm::System::FileExists(char const*)' :-1: error: C:\Program_Library\gdcm-2.0.18-mingw32\bin/libgdcmDICT.a(gdcmGlobal.cxx.obj): bad reloc address 0xf in section.text$ ZNK4gdcm7Modules7IsEmptyEv[ _ZNK4gdcm7Modules7IsEmptyEv]'

我包括了库:

LIBS += -L"C:\Program_Library\gdcm-2.0.18-mingw32\bin" \ -L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmMSFF.a" \ -L"C: \Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmCommon.a"\ -L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmDICT.a"\ -L"C:\Program_Library\gdcm -2.0.18-mingw32\bin\libgdcmDSED.a"\ -L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmexpat.a"\-L"C:\Program_Library\gdcm-2.0.18 -mingw32\bin\libgdcmIOD.a"\-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmjpeg8.a"\-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin \libgdcmjpeg12.a"\-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmjpeg16.a"\-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmopenjpeg.a"\-L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmzlib.a"\-L"C:\Program_Library\gdcm-2.0.18-mingw32\ bin\libgdcmcharls.a"\ -L"C:\Program_Library\gdcm-2.0.18-mingw32\bin\libgdcmgetopt.a"

LIBS += -lgdcmMSFF -lgdcmCommon -lgdcmDICT -lgdcmDSED -lgdcmexpat -lgdcmIOD -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmopenjpeg -lgdcmzlib -lgdcmcharls -lgdcmgetopt

有人会知道发生了什么吗?谢谢!

4

1 回答 1

1

Qt 5.1 使用 g++ 4.8,我使用 g++ 4.6 编译 gdcm!那就是问题所在!但是,当我包括:

包括 <gdcmGlobal.h>

出现这个错误:

gdcmGlobal.cxx:-1: 错误:未定义的对 `gdcm::System::FileIsDirectory(char const*)' 的引用

但是当我删除时:include < gdcmGlobal.h>,编译!

于 2013-11-15T10:54:47.923 回答