[Insight-users] link issue

Luis Ibanez luis.ibanez at kitware.com
Thu Sep 13 08:23:57 EDT 2007


Hi Delphine,


Thanks for letting us know that you found the solution.


    Regards,


       Luis


-------------------------------
delphine.ribes at epfl.ch wrote:
> Hi Luis,
> 
> I add 2 lines in the CMakelists :
> 
> FIND_LIBRARY(FltkImageViewer_LIBRARY NAMES FltkImageViewer )
> 
> And now it is working.
> 
> Thanks a lot
> Delphine
> 
> 
> #############################################
> # PROJECT: RadioactivImagesTool             #
> #############################################
> PROJECT(RadioactivImagesTool)
> 
> #####################################
> # FIND PACKAGES IF BUILDING OUTSIDE #
> #####################################
> 
> INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
> IF(USE_ITK_FILE)
>   INCLUDE(${USE_ITK_FILE})
> ENDIF(USE_ITK_FILE)
> 
> INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
> INCLUDE (${CMAKE_ROOT}/Modules/FindGLU.cmake)
> 
> 
> INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
> IF(USE_VTK_FILE)
>   INCLUDE(${USE_VTK_FILE})
> ENDIF(USE_VTK_FILE)
> 
> FIND_PACKAGE(FLTK)
>   IF(FLTK_FOUND)
>     INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR})
> ENDIF(FLTK_FOUND)
> 
> FIND_LIBRARY(FltkImageViewer_LIBRARY NAMES FltkImageViewer )
> 
> INCLUDE (${RadioactivImagesTool_SOURCE_DIR}/FindInsightApplications.cmake)
> 
> INCLUDE (${CMAKE_ROOT}/Modules/FindFLTK.cmake)
>   IF(HAS_FLTK)
> 
> 
> #############################################
> # SOURCE FILE SPECIFICATION                 #
> #############################################
> 
> 
> SET(LOGIC_CXX
>      	main.cxx
>       	RadioactivImagesToolActionMainWindowGUI.cxx
> 	RadioactivImagesToolActionRegistrationToolBoxGUI.cxx
> 	RadioactivImagesToolActionMainMenuGUI.cxx
> 	RadioactivImagesToolActionPreprocWindowGUI.cxx
> 	ActionBase.cxx
> )
> 
> # The headers for the Logic code
> SET(LOGIC_HEADERS
>       	RadioactivImagesToolActionGUI.h
> 	RadioactivimagesTool_GUI.h
> 	ActionBase.h
> )
> 
> # The FL files for Tool
> SET(MAIN_GUI_SRCS
> 	RadioactivImagesTool_GUI.fld
> )
> 
> #############################################
> # LIBRARIES AND EXTERNAL CODE               #
> #############################################
> 
>   # Include directories
>     INCLUDE_DIRECTORIES (
>       ${InsightApplications_SOURCE_DIR}/Auxiliary/FltkImageViewer
>       ${FLTK_INCLUDE_PATH}
>       ${OPENGL_INCLUDE_PATH}
>       ${FLTK_INCLUDE_DIR}/src
>     )
> 
>     LINK_DIRECTORIES(
>       ${InsightApplications_BINARY_DIR}/Auxiliary/FltkImageViewer
>       ${FLTK_DIR}/bin
>       ${FLTK_DIR}/lib
>     )
> 
>     FLTK_WRAP_UI( RadioactivImagesTool ${MAIN_GUI_SRCS} )
> 
>     ADD_EXECUTABLE( RadioactivImagesTool  ${LOGIC_CXX} ${LOGIC_HEADERS}
> ${RadioactivImagesTool_FLTK_UI_SRCS})
> 
> 
>     TARGET_LINK_LIBRARIES( RadioactivImagesTool
>       ${ITK_LIBRARIES}
>       ${VTK_LIBRARIES}
>       ${OPENGL_LIBRARY}
>       ${FltkImageViewer}
>       ${FLTK_LIBRARY}}
>     )
> 
> 
>   ENDIF(HAS_FLTK)
> ENDIF(USE_FLTK)
> 
> 
> Selon Luis Ibanez <luis.ibanez at kitware.com>:
> 
> 
>>Hi Delphine
>>
>>
>>The symbol
>>
>>                      ifuShowText()
>>
>>is defined in
>>
>>    InsightApplications/Auxiliary/FltkImageViewer
>>
>>in the files
>>
>>             fltkUtils.*
>>
>> From your error message, it looks like you are building
>>this library as a Shared library, and since the declaration
>>of this function doesn't have the EXPORT, then the symbol
>>is not available for linking.
>>
>>You can try building the library as a STATIC library
>>or you could add the EXPORT to the function (and probably
>>will have to add it for other functions too...)
>>
>>
>>Please let us know what you find....
>>
>>
>>    Thanks
>>
>>
>>       Luis
>>
>>
>>-----------------------
>>Delphine Ribes wrote:
>>
>>>Hi,
>>>
>>>I am using InsightToolkit-3.2.0, InsightApplications-3.0.0 and fltk-1.1.7.
>>>I've created a user interface using fltk and  GLSliceView.h
>>>
>>>When I compile it, I get the following error :
>>>RadioactivImagesTool error LNK2019: unresolved external symbol "int
>>>__cdecl ifuShowText(char const *)" (?ifuShowText@@ YAHPBD at Z) referenced
>>>in function "public: virtual int __thiscall itk::SliceView<unsigned
>>>short>::handle(int)" (?handle@?$SliceView at G@itk@@UAEHH at Z)
>>>
>>>Any ideas ?
>>>Thanks
>>>Delphine
>>>
>>>This is the CMakelists :
>>>#############################################
>>># PROJECT: RadioactivImagesTool             #
>>>#############################################
>>>PROJECT(RadioactivImagesTool)
>>>
>>>#####################################
>>># FIND PACKAGES IF BUILDING OUTSIDE #
>>>#####################################
>>>
>>>INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
>>>IF(USE_ITK_FILE)
>>>  INCLUDE(${USE_ITK_FILE})
>>>ENDIF(USE_ITK_FILE)
>>>
>>>INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
>>>INCLUDE (${CMAKE_ROOT}/Modules/FindGLU.cmake)
>>>
>>>FIND_PACKAGE(FLTK)
>>>  IF(FLTK_FOUND)
>>>    INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR})
>>>ENDIF(FLTK_FOUND)
>>>
>>>
>>>INCLUDE (${RadioactivImagesTool_SOURCE_DIR}/FindInsightApplications.cmake)
>>>
>>>INCLUDE (${CMAKE_ROOT}/Modules/FindFLTK.cmake)
>>>  IF(HAS_FLTK)
>>>
>>>
>>>#############################################
>>># SOURCE FILE SPECIFICATION                 #
>>>#############################################
>>>
>>>
>>>SET(LOGIC_CXX
>>>         main.cxx
>>>          RadioactivImagesToolActionMainWindowGUI.cxx
>>>    RadioactivImagesToolActionRegistrationToolBoxGUI.cxx
>>>    RadioactivImagesToolActionMainMenuGUI.cxx
>>>    ActionBase.cxx
>>>)
>>>
>>># The headers for the Logic code
>>>SET(LOGIC_HEADERS
>>>          RadioactivImagesToolActionGUI.h
>>>    RadioactivimagesTool_GUI.h
>>>    ActionBase.h
>>>)
>>>
>>># The FL files for Tool
>>>SET(MAIN_GUI_SRCS
>>>    RadioactivImagesTool_GUI.fld
>>>)
>>>
>>>#############################################
>>># LIBRARIES AND EXTERNAL CODE               #
>>>#############################################
>>>
>>>  # Include directories
>>>    INCLUDE_DIRECTORIES (
>>>      ${InsightApplications_SOURCE_DIR}/Auxiliary/FltkImageViewer
>>>      ${FLTK_INCLUDE_PATH}
>>>      ${OPENGL_INCLUDE_PATH}
>>>      ${FLTK_INCLUDE_DIR}/src
>>>    )
>>>
>>>    LINK_DIRECTORIES(
>>>      ${InsightApplications_BINARY_DIR}/Auxiliary/FltkImageViewer
>>>      ${FLTK_DIR}/bin
>>>      ${FLTK_DIR}/lib
>>>    )
>>>
>>>
>>>    FLTK_WRAP_UI( RadioactivImagesTool ${MAIN_GUI_SRCS} )
>>>
>>>    ADD_EXECUTABLE( RadioactivImagesTool  ${LOGIC_CXX} ${LOGIC_HEADERS}
>>>${RadioactivImagesTool_FLTK_UI_SRCS})
>>>
>>>    TARGET_LINK_LIBRARIES( RadioactivImagesTool
>>>      ${ITK_LIBRARIES}
>>>      ${VTK_LIBRARIES}
>>>      ${OPENGL_LIBRARY}
>>>      ${FltkImageViewer}
>>>      ${FLTK_LIBRARY}
>>>    )
>>>
>>>
>>>  ENDIF(HAS_FLTK)
>>>ENDIF(USE_FLTK)
>>>
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> 
> 


More information about the Insight-users mailing list