我正在尝试使用DCMTK库在Qt创建器中运行一个简单的应用程序,但它不能正常工作。我收到以下消息:
error: undefined reference to `DicomImage::DicomImage(char const*, unsigned long, unsigned long, unsigned long)'
main.cpp中:
#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmdata/dctk.h"
#include "dcmtk/dcmimgle/dcmimage.h"
#include "iostream"
int main(int argc, char *argv[])
{
DicomImage *image = new DicomImage("test.dcm");
if (image != NULL){
std::cout << "hell yeah!";
}
return 0;
}
.pro文件:
#-------------------------------------------------
#
# Project created by QtCreator 2016-02-18T19:16:51
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled1
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
#------------------
CONFIG += c++11
INCLUDEPATH += "C:\Program Files (x86)\DCMTK_1\include"
LIBS += -L"C:\Program Files (x86)\DCMTK_1\lib"
LIBS +=-ldcmimgle -ldcmdata -loflog -lofstd
win32:LIBS += -lAdvapi32 -lofstd -loflog -ldcmdata -ldcmnet -ldcmimage -ldcmimgle -lws2_32 -lnetapi32 -lwsock32
我觉得.pro文件有问题,但我无法弄明白。我已经包含了必要的库但仍然没有用..我读过DCMTK的库的顺序很重要,但我认为它已经按顺序排列,无法弄清楚可能是什么。你能解决这个问题吗?