[Insight-users] creating ITK dll with MS Visual C++ 6.0

Haris Saybasili haris.saybasili at gmail.com
Mon May 1 04:37:51 EDT 2006


Hi,

I am trying to create a dll using ITK. I am trying a very simple
application:

---------------
    typedef itk::Image< unsigned short, 3 > ImageType;

    ImageType::Pointer image = ImageType::New();
    std::cout << "ITK Hello World !" << std::endl;
    FILE *f;
    f = fopen("c:/temp/itk.txt","w");
    fprintf(f,"itk : hello world!!!\n");
    fclose(f);
------------------

There is nothing more in it. But I have some problems with msvc 6.0. I
modified the makefile (.mak) exported from Visual C++ project, included all
the ITK libraries, and other necessary libraries. But when I try to compile
(make) it with nmake provided by msvc 6.0:

.................
    Searching C:\ITK\bin\bin\Debug\itksys.lib:
    Searching C:\MSVStudio6\VC98\lib\kernel32.lib:
    Searching C:\MSVStudio6\VC98\lib\user32.lib:
    Searching C:\MSVStudio6\VC98\lib\gdi32.lib:
    Searching C:\MSVStudio6\VC98\lib\winspool.lib:
    Searching C:\MSVStudio6\VC98\lib\comdlg32.lib:
    Searching C:\MSVStudio6\VC98\lib\advapi32.lib:
    Searching C:\MSVStudio6\VC98\lib\shell32.lib:
    Searching C:\MSVStudio6\VC98\lib\ole32.lib:
    Searching C:\MSVStudio6\VC98\lib\oleaut32.lib:
    Searching C:\MSVStudio6\VC98\lib\uuid.lib:
    Searching C:\MSVStudio6\VC98\lib\odbc32.lib:
    Searching C:\MSVStudio6\VC98\lib\odbccp32.lib:
    Searching C:\MSVStudio6\VC98\lib\msvcrtd.lib:
    Searching C:\ITK\bin\bin\Debug\ITKAlgorithms.lib:
    Searching C:\ITK\bin\bin\Debug\ITKBasicFilters.lib:
    Searching C:\ITK\bin\bin\Debug\ITKCommon.lib:
    Searching C:\ITK\bin\bin\Debug\ITKDICOMParser.lib:
    Searching C:\ITK\bin\bin\Debug\ITKEXPAT.lib:
    Searching C:\ITK\bin\bin\Debug\ITKFEM.lib:
    Searching C:\ITK\bin\bin\Debug\itkgdcm.lib:
    Searching C:\ITK\bin\bin\Debug\ITKIO.lib:
    Searching C:\ITK\bin\bin\Debug\itkjpeg8.lib:
    Searching C:\ITK\bin\bin\Debug\itkjpeg12.lib:
    Searching C:\ITK\bin\bin\Debug\itkjpeg16.lib:
    Searching C:\ITK\bin\bin\Debug\ITKMetaIO.lib:
    Searching C:\ITK\bin\bin\Debug\itknetlib.lib:
    Searching C:\ITK\bin\bin\Debug\ITKniftiio.lib:
    Searching C:\ITK\bin\bin\Debug\ITKNrrdIO.lib:
    Searching C:\ITK\bin\bin\Debug\ITKNumerics.lib:
    Searching C:\ITK\bin\bin\Debug\itkpng.lib:
    Searching C:\ITK\bin\bin\Debug\ITKSpatialObject.lib:
    Searching C:\ITK\bin\bin\Debug\ITKStatistics.lib:
    Searching C:\ITK\bin\bin\Debug\itktestlib.lib:
    Searching C:\ITK\bin\bin\Debug\itktiff.lib:
    Searching C:\ITK\bin\bin\Debug\itkvcl.lib:
    Searching C:\ITK\bin\bin\Debug\itkvnl.lib:
    Searching C:\ITK\bin\bin\Debug\itkvnl_algo.lib:
    Searching C:\ITK\bin\bin\Debug\itkvnl_inst.lib:
    Searching C:\ITK\bin\bin\Debug\itkzlib.lib:
    Searching C:\ITK\bin\bin\Debug\ITKznz.lib:
    Searching C:\MSVStudio6\VC98\lib\OLDNAMES.lib:
    Searching C:\MSVStudio6\VC98\lib\msvcprtd.lib:
    Searching C:\ITK\bin\bin\Debug\itksys.lib:
    Searching C:\MSVStudio6\VC98\lib\kernel32.lib:
    Searching C:\MSVStudio6\VC98\lib\user32.lib:

Done Searching Libraries
myitk.obj : error LNK2001: unresolved external symbol "class
std::basic_ostream<char,struct std::char_traits<char> > std::cout"
(?cout at std@@3V?$basic_ostream at DU?$char_traits at D@std@@@1 at A)
myitk.obj : error LNK2001: unresolved external symbol "__int64 const
std::_Fpz" (?_Fpz at std@@3_JB)
myitk.obj : error LNK2001: unresolved external symbol "private: static class
std::locale::_Locimp * std::locale::_Locimp::_Global" (?_Global at _Locimp@
locale at std@@0PAV123 at A)
myitk.obj : error LNK2001: unresolved external symbol "private: static int
std::locale::id::_Id_cnt" (?_Id_cnt at id@locale at std@@0HA)
.\Debug\myitk.dll : fatal error LNK1120: 4 unresolved externals


How this can happen?? How can it be unable to find cout??? I don't know what
to do.

I know that this is a really bad idea to use visual c++ 6.0 compiler, as it
is old and does not complies with ANSI C++. But I have to use it. I managed
to compile it as a static library, but I need a dynamic one.

Anybody has an idea?

Thanks in advance,

haris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060501/524f6d8b/attachment.htm


More information about the Insight-users mailing list