首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mac中带有qt的DCMTK库

mac中带有qt的DCMTK库
EN

Stack Overflow用户
提问于 2019-04-25 03:12:55
回答 1查看 192关注 0票数 1

我通过brew安装了DCMTK,并在qt上进行了配置,添加了指向该库的路径。当我尝试打开DICOM图像并运行项目时,出现以下两个错误:Undefined symbols for architecture x86_64: "DicomImage::DicomImage(char const*, unsigned long, unsigned long, unsigned long)", referenced from: MainWindow::on_pushButton_clicked() in mainwindow.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [testDicom.app/Contents/MacOS/testDicom] Error 1 21:04:21: The process "/usr/bin/make" exited with code 2. Error while building/deploying project testDicom (kit: Desktop Qt 5.12.1 clang 64bit) When executing step "Make" 21:04:21: Elapsed time: 00:00.我该如何解决它?

更新(this is my file.pro):

代码语言:javascript
复制
#
# Project created by QtCreator 2019-04-24T20:43:01
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = testDicom
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

CONFIG += c++11

SOURCES += \
        main.cpp \
        mainwindow.cpp

HEADERS += \
        mainwindow.h

INCLUDEPATH += /usr/local/Cellar/dcmtk/3.6.4/include \


LIBS += -L/usr/local/lib \
        -L/usr/local/Cellar/dcmtk/3.6.4/lib \
        -L/usr/local/Cellar/dcmtk/3.6.4/bin


FORMS += \
        mainwindow.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-26 16:48:57

问题解决了,我在这里发布解决方案,因为它可能对某些人有帮助。当包含dcmtk时,还必须包含zlib和libiconv。

INCLUDEPATH += /usr/local/Cellar/dcmtk/3.6.4/INCLUDEPATH\/usr/local/opt/zlib/lib/INCLUDEPATH include /usr/local/Cellar/dcmtk/3.6.4/include \/usr/local/opt/zlib/include

LIBS += -L/usr/local/lib \ -L/usr/local/Cellar/opencv/4.1.0_1/lib \ -L/usr/local/Cellar/dcmtk/3.6.4/lib \ -ldcmdata \ -ldcmimgle \ -ldcmjpeg \ -loflog \ -ldcmpstat \ -lofstd \ -liconv \ -lz

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55837066

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档