<div style="direction: ltr;">Hi,<br><br>I tried cmake, it created the
project. However, Visual C++ couldn't compile it. I had 44 errors, all
of which was unresolved references. I added additional lib and include
libraries to the project, but no luck. I exported the makefile, and
edited it. I get the same error as always:<br><br>.................<br> Searching C:\ITK\bin\bin\Debug\itksys.lib:<br><div style="direction: ltr;"> Searching C:\MSVStudio6\VC98\lib\kernel32.lib:<br> Searching C:\MSVStudio6\VC98\lib\user32.lib:
<br> Searching C:\MSVStudio6\VC98\lib\gdi32.lib:
<br> Searching C:\MSVStudio6\VC98\lib\winspool.lib:<br> Searching C:\MSVStudio6\VC98\lib\comdlg32.lib:<br> Searching C:\MSVStudio6\VC98\lib\advapi32.lib:<br> Searching C:\MSVStudio6\VC98\lib\shell32.lib:<br> Searching C:\MSVStudio6\VC98\lib\ole32.lib:
<br> Searching C:\MSVStudio6\VC98\lib\oleaut32.lib:<br> Searching C:\MSVStudio6\VC98\lib\uuid.lib:<br> Searching C:\MSVStudio6\VC98\lib\odbc32.lib:<br> Searching C:\MSVStudio6\VC98\lib\odbccp32.lib:<br> Searching C:\MSVStudio6\VC98\lib\msvcrtd.lib:
<br> Searching C:\ITK\bin\bin\Debug\ITKAlgorithms.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKBasicFilters.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKCommon.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKDICOMParser.lib:
<br> Searching C:\ITK\bin\bin\Debug\ITKEXPAT.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKFEM.lib:<br> Searching C:\ITK\bin\bin\Debug\itkgdcm.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKIO.lib:<br> Searching C:\ITK\bin\bin\Debug\itkjpeg8.lib:
<br> Searching C:\ITK\bin\bin\Debug\itkjpeg12.lib:<br> Searching C:\ITK\bin\bin\Debug\itkjpeg16.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKMetaIO.lib:<br> Searching C:\ITK\bin\bin\Debug\itknetlib.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKniftiio.lib:
<br> Searching C:\ITK\bin\bin\Debug\ITKNrrdIO.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKNumerics.lib:<br> Searching C:\ITK\bin\bin\Debug\itkpng.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKSpatialObject.lib:<br>
Searching C:\ITK\bin\bin\Debug\ITKStatistics.lib:<br> Searching C:\ITK\bin\bin\Debug\itktestlib.lib:<br> Searching C:\ITK\bin\bin\Debug\itktiff.lib:<br> Searching C:\ITK\bin\bin\Debug\itkvcl.lib:<br> Searching C:\ITK\bin\bin\Debug\itkvnl.lib:
<br> Searching C:\ITK\bin\bin\Debug\itkvnl_algo.lib:<br> Searching C:\ITK\bin\bin\Debug\itkvnl_inst.lib:<br> Searching C:\ITK\bin\bin\Debug\itkzlib.lib:<br> Searching C:\ITK\bin\bin\Debug\ITKznz.lib:<br> Searching C:\MSVStudio6\VC98\lib\OLDNAMES.lib:
<br> Searching C:\MSVStudio6\VC98\lib\msvcprtd.lib:<br> Searching C:\ITK\bin\bin\Debug\itksys.lib:<br> Searching C:\MSVStudio6\VC98\lib\kernel32.lib:<br> Searching C:\MSVStudio6\VC98\lib\user32.lib:</div>Done Searching Libraries
<br>myitk.obj : error LNK2001: unresolved external symbol "class
std::basic_ostream<char,struct std::char_traits<char> >
std::cout" (?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)<br>myitk.obj
: error LNK2001: unresolved external symbol "__int64 const std::_Fpz" (?_Fpz@std@@3_JB)<br>myitk.obj
: error LNK2001: unresolved external symbol "private: static class
std::locale::_Locimp * std::locale::_Locimp::_Global"
(?_Global@_Locimp@
locale@std@@0PAV123@A)<br>myitk.obj : error LNK2001: unresolved
external symbol "private: static int std::locale::id::_Id_cnt"
(?_Id_cnt@id@locale@std@@0HA)<br>.\Debug\myitk.dll : fatal error LNK1120: 4 unresolved externals
<br><br><br>I had searched the net, and saw that these kind of errors are
very common to vc++ 6.0. Is there anybody who succeded in creating an
ITK DLL with msvc++ 6.0?<br><br>I am new to windows application development (I use linux normally), so maybe I made a very elemental error.<br><br>Thanks,<br><br>haris<br><br>PS: And for the DLL part, my code was like this:
<br><br>----------------<br>1. myitk.h:<br>----------------<br><br>#ifndef __HELLO_H<br>#define __HELLO_H<br>#ifndef __HELLO__<br>#define __HELLOLIB__ __declspec(dllimport)<br>#else<br>#define __HELLOLIB__ __declspec(dllexport)
<br>#endif<br>__HELLOLIB__ int myitkhello() ;<br>#endif<br><br>#include "C:\ITK\src\Code\Common\itkWin32Header.h"<br>#include "itkImage.h"<br><br><br>class myitk<br>{<br> public:<br> <br> myitk();
<br><br> ~myitk();<br><br>};<br><br>----------------<br>myitk.cpp:<br>----------------<br><br>#define __HELLO__<br>#include "myitk.h"<br><br>myitk::myitk() {</div><div style="direction: ltr;"><span class="q">
<br> <br> typedef itk::Image< unsigned short, 3 > ImageType;
<br> <br> ImageType::Pointer image = ImageType::New();<br> std::cout << "ITK Hello World !" << std::endl;<br> FILE *f;<br> f = fopen("c:/temp/itk.txt","w");<br>
fprintf(f,"itk : hello world!!!\n");<br> fclose(f);<br> <br>}<br><br><br></span></div>myitk::~myitk()<br>{<br><br>}<br><br>__HELLOLIB__ int myitkhello() {<br> <br> myitk mtk();<br> return 0;
<br>}