[Insight-users] Problem for building DLL from ITK

Bo Zhou bzhou at nd.edu
Sun Apr 20 23:54:51 EDT 2008


Hi All,
  I've been trying to build a DLL from ITK using MSDEV 6.0. However I encountered some problems and hope someone can help me and I really appreciate.

  To be simple enough, my test followed these steps:

1. I used wizard-generated source files from MSDEV and put them together with the following Cmakelist.txt file.
    ---------------------------------------------------------------  
    PROJECT(ITKLib)

    # Find ITK.
    FIND_PACKAGE(ITK)
    IF(ITK_FOUND)
     INCLUDE(${ITK_USE_FILE})
    ELSE(ITK_FOUND)
     MESSAGE(FATAL_ERROR
          "Cannot build without ITK.  Please set ITK_DIR.")
    ENDIF(ITK_FOUND)

    ADD_LIBRARY(ITKLib SHARED ITKLib32.cpp StdAfx.cpp) 
    --------------------------------------------------------------
2. Cmake 2.4 was used to configure the project and the project was built into another directory.(Cmake did find the ITK directory)
3. I opened the generated project and built all. Following messages appeared:
    D:\Image_Registration\Program\ITKLib\ITKLib32.cpp(25) : error C2491: 'nITKLib32' : definition of dllimport data not allowed
    D:\Image_Registration\Program\ITKLib\ITKLib32.cpp(29) : error C2491: 'fnITKLib32' : definition of dllimport function not allowed
    D:\Image_Registration\Program\ITKLib\ITKLib32.cpp(36) : warning C4273: 'CITKLib32::CITKLib32' : inconsistent dll linkage.  dllexport assumed.


    The source files shall be ok because they are generated by wizard and I did generated DLL successfully without using Cmake.
    Has anyone had the similar problem before? your guidline will be really helpful and I really appreciate it.
 
   Thanks and have a nice day!

 

   
 				
--------------
Bo Zhou



More information about the Insight-users mailing list