我尝试在linux机器中配置DCMTK库,但在构建应用程序时遇到以下错误.... [英] I tried to configure DCMTK library in linux machine but while building the app getting following errors....

查看:118
本文介绍了我尝试在linux机器中配置DCMTK库,但在构建应用程序时遇到以下错误....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误:未定义引用`DcmFileFormat :: DcmFileFormat()'

错误:未定义引用`DcmFileFormat :: loadFile(OFFilename const&,E_TransferSyntax,E_GrpLenEncoding,unsigned long,E_FileReadMode)'

错误:未定义引用`DcmItem :: findAndGetString(DcmTagKey const&,char const *&,bool)'

错误:未定义引用`DcmItem :: findAndGetString( DcmTagKey const&,char const *&,bool)'

错误:未定义引用`DcmItem :: findAndGetString(DcmTagKey const&,char const *&,bool)'

错误:未定义引用`DcmDataset :: getCurrentXfer()const'

错误:未定义引用`DcmXfer :: DcmXfer(E_TransferSyntax)'

错误:undefined引用`DcmXfer :: ~DcmXfer()'

错误:未定义引用`DcmFileFormat :: ~DcmFileFormat()'

错误:未定义引用`DcmXfer :: ~DcmXfer()'

错误:未定义对`DcmFileFormat的引用::〜DcmFileFormat()'

错误:collect2:错误:ld返回1退出状态



我尝试过:



我添加了DCMTK静态库并在QT中包含路径并试图构建但是出错。



请帮助...

解决方案

未定义的引用错误告诉您没有将应用程序与包含对应函数的库链接( s)。



您必须使用 LIBS 变量在Qt项目文件中添加库路径和名称。在那里,您可以使用 -L 指定其他路径,使用 -l <​​/ code>指定库名称(包含路径不用于库) ):

 LIBS + = -L<路径到DCMTK-libraries = DCMTK_INSTALL_LIBDIR> -l< library-name> 

动态库示例:

 LIBS + = -L / usr / local / dcmtk12 -ldcmtk12_3.6.2 

静态库的示例:

 LIBS + = -L / usr / local / dcmtk12 -llibdcmtk12_3.6.2.a 


error: undefined reference to `DcmFileFormat::DcmFileFormat()'
error: undefined reference to `DcmFileFormat::loadFile(OFFilename const&, E_TransferSyntax, E_GrpLenEncoding, unsigned long, E_FileReadMode)'
error: undefined reference to `DcmItem::findAndGetString(DcmTagKey const&, char const*&, bool)'
error: undefined reference to `DcmItem::findAndGetString(DcmTagKey const&, char const*&, bool)'
error: undefined reference to `DcmItem::findAndGetString(DcmTagKey const&, char const*&, bool)'
error: undefined reference to `DcmDataset::getCurrentXfer() const'
error: undefined reference to `DcmXfer::DcmXfer(E_TransferSyntax)'
error: undefined reference to `DcmXfer::~DcmXfer()'
error: undefined reference to `DcmFileFormat::~DcmFileFormat()'
error: undefined reference to `DcmXfer::~DcmXfer()'
error: undefined reference to `DcmFileFormat::~DcmFileFormat()'
error: collect2: error: ld returned 1 exit status

What I have tried:

I was added DCMTK static library and include path in QT and tried to build but getting errors.

please help...

解决方案

The "undefined reference" error tells you that you did not link your application with the library containing the correspoding function(s).

You have to add the library path and name in your Qt project file using the LIBS variable. There you can specify additional pathes with -L and library names with -l (the include path is not used for libraries):

LIBS += -L<path-to-DCMTK-libraries = DCMTK_INSTALL_LIBDIR> -l<library-name>

Example for dynamic library:

LIBS += -L/usr/local/dcmtk12 -ldcmtk12_3.6.2

Example for static library:

LIBS += -L/usr/local/dcmtk12 -llibdcmtk12_3.6.2.a


这篇关于我尝试在linux机器中配置DCMTK库,但在构建应用程序时遇到以下错误....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆