【发布时间】:2014-04-18 08:13:03
【问题描述】:
#include <dcmtk\oflog\config.h>
#include <dcmtk\dcmimgle\dcmimage.h>
#include <dcmtk\dcmnet\dicom.h>
#include <dcmtk\config\osconfig.h>
#include <iostream>
#include <fstream>
#include <ostream>
#include <iomanip>
#include<dcmtk\ofstd\ofstream.h>
#include<dcmtk\dcmdata\dctk.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:函数 _main c:\Users\prashant naresh\documents\visual studio 中引用的未解析外部符号“public: __thiscall OFString::~OFString(void)”(??1OFString@@QAE@XZ) 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
错误 2 错误 LNK2019:函数 _main c:\Users\prashant naresh\documents 中引用的未解析外部符号“public: __thiscall OFString::OFString(char const *)”(??0OFString@@QAE@PBD@Z) \visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
错误 3 错误 LNK2019:在函数 _main c:\Users\prashant naresh\documents\visual studio 2010\项目\dcmimage\dcmimage\dcmimage.obj dcmimage
错误 4 错误 LNK2019:函数 _main 中引用的未解析外部符号“public: __thiscall DicomImage::DicomImage(char const *,unsigned long,unsigned long,unsigned long)”(??0DicomImage@@QAE@PBDKKK@Z) c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
错误 5 错误 LNK2019:函数 _main c 中引用的未解析外部符号“public: static void __cdecl OFLog::configure(enum OFLogger::LogLevel)”(?configure@OFLog@@SAXW4LogLevel@OFLogger@@@Z): \Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.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:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.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:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
错误 LNK2019:未解析的外部符号“public: virtual __thiscall log4cplus::Logger::~Logger(void)”(??1Logger@log4cplus@@UAE@XZ) 在函数“public: virtual __thiscall OFLogger::~”中引用OFLogger(void)" (??1OFLogger@@UAE@XZ) c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage
error LNK1120: 8 unresolved externals c:\users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\Debug\dcmimage.exe dcmimage
【问题讨论】:
-
您是否将必要的
.lib文件添加到项目属性--> 链接器--> 输入--> 附加依赖项? -
没有理由在这段代码中使用
new...这样声明image会更安全(读取异常安全):DicomImage image("E:\\datamining project\\dataset\\Lung CT image\\nodules\\nodules\\23.dcm", CIF_UsePartialAccessToPixelData, 0, 10 /* fcount */);
标签: c++ visual-studio-2010 opencv