【问题标题】:link error while open dicom image in .net using open cv使用open cv在.net中打开dicom图像时链接错误
【发布时间】: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


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-22
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      • 2018-07-12
      • 1970-01-01
      • 2021-10-14
      • 2017-09-02
      相关资源
      最近更新 更多