[Insight-users] Atttempting to build DicomImageViewer

wwhartenby at physics.ucsd.edu wwhartenby at physics.ucsd.edu
Wed Jun 18 13:38:55 EDT 2008


I am trying to build DicomImageViewer in Visual studio using CMake2.6.
Below is the CMake file I use, and abelow that is a list of errors I get.
I am sure that I built ITK and FLTK correctly (in that order) Anyone know
why this is? Please also reply to my e-mail if you do. Thanks!

*****************CMAKEFILE

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::Indent::Indent(int)"
(??0Indent at itk@@QAE at H@Z) already defined in
DicomImageViewer.obj	ITKCommon.lib
Error	2	error LNK2005: "public: virtual __thiscall
itk::Region::~Region(void)" (??1Region at itk@@UAE at XZ) already defined in
DicomImageViewer.obj	ITKCommon.lib
Error	3	error LNK2005: "public: __thiscall itk::Region::Region(void)"
(??0Region at itk@@QAE at XZ) already defined in
DicomImageViewer.obj	ITKCommon.lib
Error	4	error LNK2005: "public: virtual __thiscall
itk::ExceptionObject::~ExceptionObject(void)"
(??1ExceptionObject at itk@@UAE at XZ) already defined in
DicomImageViewer.obj	ITKCommon.lib
Error	5	error LNK2005: "public: __thiscall
itk::ExceptionObject::ExceptionObject(class itk::ExceptionObject const &)"
(??0ExceptionObject at itk@@QAE at ABV01@@Z) already defined in
DicomImageViewer.obj	ITKCommon.lib
Error	6	error LNK2005: "public: __thiscall
itk::ExceptionObject::ExceptionObject(char const *,unsigned int,char const
*,char const *)" (??0ExceptionObject at itk@@QAE at PBDI00@Z) already defined in
DicomImageViewer.obj	ITKCommon.lib
Error	7	error LNK2005: "public: virtual void __thiscall
itk::ExceptionObject::SetLocation(char const *)"
(?SetLocation at ExceptionObject@itk@@UAEXPBD at Z) already defined in
DicomImageViewer.obj	ITKCommon.lib
Error	8	error LNK2005: "public: virtual void __thiscall
itk::ExceptionObject::SetDescription(char const *)"
(?SetDescription at ExceptionObject@itk@@UAEXPBD at Z) already defined in
DicomImageViewer.obj	ITKCommon.lib
Error	9	error LNK2001: unresolved external symbol "public: static double
const itk::NumericTraits<double>::Zero"
(?Zero@?$NumericTraits at N@itk@@2NB)	DicomImageViewer.obj
Error	10	fatal error LNK1120: 1 unresolved
externals	N:\Will\CERR\ITK\TestBed\DicomImageViewer-binary\Debug\DicomImageViewer.exe	1




More information about the Insight-users mailing list