在.net中使用open cv打开dicom图像时链接错误

link error while open dicom image in .net using open cv

本文关键字:图像 dicom 链接 错误 打开 cv net open      更新时间:2023-10-16
#include <dcmtkoflogconfig.h>
#include <dcmtkdcmimgledcmimage.h>
#include <dcmtkdcmnetdicom.h>
#include <dcmtkconfigosconfig.h>
#include <iostream>
#include <fstream>
#include <ostream>
#include <iomanip>
#include<dcmtkofstdofstream.h>
#include<dcmtkdcmdatadctk.h>
int main(int argc, char *argv[])
{
OFLog::configure(OFLogger::INFO_LOG_LEVEL);
DicomImage *image = new DicomImage("E:\datamining project\dataset\Lung CT         image\nodules\nodules\23.dcm", CIF_UsePartialAccessToPixelData, 0, 10 /* fcount */); 
if (image->getStatus() == EIS_Normal)
{
    do {
        DCMIMGLE_INFO("processing frame " << image->getFirstFrame() + 1 << " to "<<                  image->getFirstFrame() + image->getFrameCount());
    } while (image->processNextFrames());
}
delete image;
return 0;
}    

错误1错误LNK2019:未解析的外部符号"public: __thiscall OFString::~OFString(void)"(?? 10ofstring @@QAE@XZ)在函数_main c:Usersprashant nareshdocumentsvisual studio 2010Projectsdcmimagedcmimage。obj dcmimage

错误2错误LNK2019:未解析的外部符号"public: __thiscall OFString::OFString(char const *)"(??0OFString@@QAE@PBD@Z)在函数_main c:Usersprashant nareshdocumentsvisual studio 2010Projectsdcmimagedcmimagedcmimage中引用。obj dcmimage

错误3错误LNK2019:未解析的外部符号"class OFLogger __cdecl DCM_dcmimgleGetLogger(void)"(?DCM_dcmimgleGetLogger@@YA?AVOFLogger@@XZ)引用于函数_main c:Usersprashant nareshdocumentsvisual studio 2010Projectsdcmimagedcmimagedcmimage。obj dcmimage

错误4错误LNK2019:未解析的外部符号"public: __thiscall DicomImage::DicomImage(char const *,unsigned long,unsigned long,unsigned long)"(??0DicomImage@@QAE@PBDKKK@Z)在函数_main c:Usersprashant nareshdocumentsvisual studio 2010Projectsdcmimagedcmimagedcmimage中引用。obj dcmimage

错误5错误LNK2019:未解析的外部符号"public: static void __cdecl OFLog::configure(enum OFLogger::LogLevel)"(?configure@OFLog@@SAXW4LogLevel@OFLogger@@@ z)在函数_main中引用c:Usersprashant nareshdocumentsvisual studio 2010Projectsdcmimagedcmimagedcmimage。obj dcmimage

错误6错误LNK2019:未解析的外部符号"public: bool __thiscall log4cplus::Logger::isEnabledFor(int)const"(?isEnabledFor@Logger@ log4cplus@QBE_NH@Z)在函数"public: bool __thiscall OFLogger::isEnabledFor(int)const"(?isEnabledFor@OFLogger@@QBE_NH@Z) c:Usersprashant nareshdocumentsvisual studio 2010Projectsdcmimagedcmimagedcmimage"中引用。obj dcmimage

错误7错误LNK2019:未解析的外部符号"public: void __thiscall log4cplus::Logger::forcedLog(int,class OFString const &,char const *,int,char const *)const"(?forcedLog@Logger@ log4cplus@qbexhabvofstring @@PBDH1@Z)在函数中引用"public:void __thiscall OFLogger::forcedLog(int,class OFString const & &;,char const *,int,char const *)const " (?forcedLog@OFLogger@@QBEXHABVOFString@@PBDH1@Z) c:Usersprashant nareshdocumentsvisual studio 2010Projectsdcmimagedcmimagedcmimage.)obj dcmimage

错误LNK2019:未解析的外部符号"public: virtual __thiscall log4cplus::Logger::~Logger(void)"(??1Logger@log4cplus@@UAE@XZ)在函数"public: virtual __thiscall OFLogger::~OFLogger(void)"中引用c:Usersprashant nareshdocumentsvisual studio 2010Projectsdcmimagedcmimagedcmimage. (?? ?)obj dcmimage

c:usersprashant nareshdocumentsvisual studio 2010ProjectsdcmimageDebugdcmimage.exe dcmimage

我的机器上没有安装CMake,所以我不能自己尝试。

看起来你必须构建各种库,这个看起来特别有趣:ofstd.lib。还有oflog.lib

请确保您将以下库链接到您的项目(项目属性->链接器->输入->附加依赖项):

 oflog.lib;ofstd.lib;iphlpapi.lib;ws2_32.lib;netapi32.lib;wsock32.lib