[Insight-users] More issues on DicomImageViewer

wwhartenby at physics.ucsd.edu wwhartenby at physics.ucsd.edu
Thu Jun 19 13:00:19 EDT 2008


Hi
  I am using MS Visual. I have tried several CMakeLists.txt (including
adding TARGET_LINK_LIBRARIES) and I still get the same couple of errors.
While I built ITKCommon.dll, it appears to be using ITKCommon.lib, which
is giving me some multiply defined symbols. Here are the errors I am
getting and the CMakelists.txt. One odd note about CMakeLists.txt; I
must specify the ".lib" at the end of the ITKLFltkImageViewer in the
LINK_LIBRARIES, otherwise it looks for an ".obj" file. This doesn't
happen when I don't include the specific path: it looks for
ITKFltkImageViewer.lib (of course, without the path information it can't
find it)
  Anyway, CMakeLists.txt below: Please note, I have tried with
TARGET_LINK_LIBRARIES, it still gives me the same error. Errors below
that. Any additional help is appreciated!
cmake_minimum_required(VERSION 2.4)
if(COMMAND cmake_policy)
  cmake_policy(SET CMP0003 NEW)
endif (COMMAND cmake_policy)
PROJECT(DicomImageViewer)
SET(InsightApplications_SOURCE_DIR
"N:/Will/CERR/ITK/InsightApplications-3.6.0")
SET(InsightApplications_BINARY_DIR "N:/Will/CERR/ITK/InsightBinary-3.6.0")

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

  FIND_PACKAGE(FLTK)
  IF(FLTK_FOUND)
    INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR})
  ENDIF(FLTK_FOUND)

  INCLUDE_DIRECTORIES(
  ${InsightApplications_SOURCE_DIR}/Auxiliary/FltkImageViewer
  )

LINK_LIBRARIES (
  ITKBasicFilters
  ITKIO
 ${InsightApplications_SOURCE_DIR}/Auxiliary/FltkImageViewer/debug/ITKFltkImageViewer.lib
 ${FLTK_LIBRARIES}

)

ADD_EXECUTABLE( DicomImageViewer DicomImageViewer.cxx )



******************ERRORS*******************

Error	1	error LNK2005: "public: __thiscall
itk::EventObject::EventObject(void)" (??0EventObject at itk@@QAE at XZ) already
defined in
ITKFltkImageViewer.lib(fltkImage2DViewerWindow.obj)	ITKCommon.lib
Error	2	error LNK2005: "public: virtual __thiscall
itk::EventObject::~EventObject(void)" (??1EventObject at itk@@UAE at XZ) already
defined in
ITKFltkImageViewer.lib(fltkImage2DViewerWindow.obj)	ITKCommon.lib




More information about the Insight-users mailing list