0
votes
#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;
}    

Error 1 error LNK2019: unresolved external symbol "public: __thiscall OFString::~OFString(void)" (??1OFString@@QAE@XZ) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage

Error 2 error LNK2019: unresolved external symbol "public: __thiscall OFString::OFString(char const *)" (??0OFString@@QAE@PBD@Z) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage

Error 3 error LNK2019: unresolved external symbol "class OFLogger __cdecl DCM_dcmimgleGetLogger(void)" (?DCM_dcmimgleGetLogger@@YA?AVOFLogger@@XZ) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage

Error 4 error LNK2019: unresolved external symbol "public: __thiscall DicomImage::DicomImage(char const *,unsigned long,unsigned long,unsigned long)" (??0DicomImage@@QAE@PBDKKK@Z) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage

Error 5 error LNK2019: unresolved external symbol "public: static void __cdecl OFLog::configure(enum OFLogger::LogLevel)" (?configure@OFLog@@SAXW4LogLevel@OFLogger@@@Z) referenced in function _main c:\Users\prashant naresh\documents\visual studio 2010\Projects\dcmimage\dcmimage\dcmimage.obj dcmimage

Error 6 error LNK2019: unresolved external symbol "public: bool __thiscall log4cplus::Logger::isEnabledFor(int)const " (?isEnabledFor@Logger@log4cplus@@QBE_NH@Z) referenced in function "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

Error 7 error LNK2019: unresolved external symbol "public: void __thiscall log4cplus::Logger::forcedLog(int,class OFString const &,char const *,int,char const *)const " (?forcedLog@Logger@log4cplus@@QBEXHABVOFString@@PBDH1@Z) referenced in function "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

error LNK2019: unresolved external symbol "public: virtual __thiscall log4cplus::Logger::~Logger(void)" (??1Logger@log4cplus@@UAE@XZ) referenced in function "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

2
Did you add the necessary .lib files to Project Properties --> Linker --> Input --> Additional Dependencies ? - Chris O
There is no reason to use new in this code... it would be a lot safer (read exception safe) to just declare image as thus: DicomImage image("E:\\datamining project\\dataset\\Lung CT image\\nodules\\nodules\\23.dcm", CIF_UsePartialAccessToPixelData, 0, 10 /* fcount */); - Mgetz

2 Answers

0
votes

I don't have CMake installed at the moment on my machine, so I can't try this out myself.

Looks likes you have to build various libraries, this one looks particularly interesting: ofstd.lib. Then there's also oflog.lib.

0
votes

Please make sure that you linked the following libraries to your project (Project Properties --> Linker --> Input --> Additional Dependencies):

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