DCMTK 库与 mac 中的 qt
DCMTK library with qt in mac
我已经通过brew安装了DCMTK,并在qt上配置了它,添加了指向库的路径。当我尝试打开 DICOM 映像并运行项目时,我有以下 2 个错误:
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.
我该如何解决?
更新(这是我的 file.pro(:
#
# 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
问题解决了,我在这里发布解决方案,因为它可能对某人有所帮助。当你包含dcmtk时,你还必须包括zlib和libiconv。
INCLUDEPATH +=/usr/local/Cellar/dcmtk/3.6.4/include \ /usr/local/opt/zlib/lib/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
- 如何将点击的信号和插槽添加到qt中的自定义按钮中
- 以在Qt中的IF语句中设置时间延迟
- 如何在QT中的自定义视频小工具t上绘制矩形
- Qt中的实现指针(PIMPL)
- Qt中的RGB图像处理
- 如何识别项目是 QT 中的文件还是文件夹
- 如何将 json 数据附加到 Qt 中的现有 json 文件中
- 通过 Qt 中的线程调用 Rust 库
- Qt中的包装连接方法隐藏了编译器所需的信息
- Qt 中的去抖动事件过滤器
- 在QT中的两个窗口之间共享websocket连接
- 如何使用Qt中的QGeopath清除Mappolyline
- 如何防止GUI挂起,同时允许第二次操作与Qt中的第一次操作一起执行
- 如何从qt中的类中调用方法
- 内联在对always_inline的调用中失败,Qt中的目标特定选项不匹配
- 项目错误:QT中的未知模块:Mac上的图表
- Qt中的QFile::copy(source,dest)的实现有时是错误的吗?
- 是否可以将文件路径传递给Qt中的setStyleSheet()
- 如何使用 qt 中的信号槽控制函数的返回
- 从 Qt 中的信号调用成员函数的问题