Hi Luis,<br><br>my CMakeLists.txt file is:<br><br>-----------------------------------------------------<br>PROJECT(myitk)<br><br># Find ITK.<br>FIND_PACKAGE(ITK)<br>IF(ITK_FOUND)<br> INCLUDE(${ITK_USE_FILE})<br>ELSE(ITK_FOUND)
<br> MESSAGE(FATAL_ERROR<br> "Cannot build without ITK. Please set ITK_DIR.")<br>ENDIF(ITK_FOUND)<br><br>ADD_LIBRARY(mytik SHARED myitk.cxx)<br>---------------------------------------------------------------------------
<br><br>Thanks a lot,<br><br>haris <br><br><div><span class="gmail_quote">On 5/1/06, <b class="gmail_sendername">Luis Ibanez</b> <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi Haris<br><br>Please post the CMakeLists.txt file that you wrote for this project.<br><br>Thanks<br><br><br> Luis<br><br><br><br>====================<br>Haris Saybasili wrote:<br>> Hi,<br>><br>> I tried cmake, it created the project. However, Visual C++ couldn't
<br>> compile it. I had 44 errors, all of which was unresolved references. I<br>> added additional lib and include libraries to the project, but no luck.<br>> 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>> 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:<br>> Done Searching Libraries<br>> myitk.obj : error LNK2001: unresolved external symbol "class
<br>> std::basic_ostream<char,struct std::char_traits<char> > std::cout"<br>> (?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)<br>> myitk.obj : error LNK2001: unresolved external symbol "__int64 const
<br>> std::_Fpz" (?_Fpz@std@@3_JB)<br>> myitk.obj : error LNK2001: unresolved external symbol "private: static<br>> class std::locale::_Locimp * std::locale::_Locimp::_Global"<br>> (?_Global@_Locimp@
locale@std@@0PAV123@A)<br>> myitk.obj : error LNK2001: unresolved external symbol "private: static<br>> 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<br>> common to vc++ 6.0. Is there anybody who succeded in creating an ITK DLL<br>> with msvc++ 6.0?<br>><br>> I am new to windows application development (I use linux normally), so
<br>> 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() {<br>><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>> myitk::~myitk()
<br>> {<br>><br>> }<br>><br>> __HELLOLIB__ int myitkhello() {<br>><br>> myitk mtk();<br>> return 0;<br>> }<br>><br>><br>> ------------------------------------------------------------------------
<br>><br>> _______________________________________________<br>> Insight-users mailing list<br>> <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>> <a href="http://www.itk.org/mailman/listinfo/insight-users">
http://www.itk.org/mailman/listinfo/insight-users</a><br><br><br></blockquote></div><br>