[Insight-users] fltk link errors

Luis Ibanez luis . ibanez at kitware . com
Thu, 02 Oct 2003 10:17:57 -0400


This is a multi-part message in MIME format.
--------------070207000104080604060207
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


Hi Bing,

Please post your CMakeLists.txt file.

Your application must link to the four FLTK
libraries

     fltk
     fltkforms
     fltkimages
     fltkgl


You can add all of them to the
TARGET_LINK_LIBRARIES command by using
"FLTK_LIBRARIES"


Please look at the attached CMakeLists.txt
file for an example on how to do this.

Note also the use of FIND_PACKAGE(FLTK)



Regards,


    Luis


-----------------------
Bing Jian wrote:
> I sent this message to fltk.general mailling list
> several days ago, but got no response so far. Hope
> I can get some help from here. Thanks!
> 
> Hello everyone,
> 
>    I have trouble linking my program with fltk-1.1.4
> in visual c++ 6.0 environment. No matter what configuaration
> I choose, it always gives following errors:
> 
> --------------------Configuration: MITK - Win32
> Debug--------------------
> Linking...
> RegDataView.obj : error LNK2001: unresolved external symbol "public:
> static int Fl::e_x" (?e_x at Fl@@2HA)
> RegDataView.obj : error LNK2001: unresolved external symbol "public:
> static int Fl::e_y" (?e_y at Fl@@2HA)
> RegDataView.obj : error LNK2001: unresolved external symbol "public:
> static int Fl::e_keysym" (?e_keysym at Fl@@2HA)
> static int Fl::e_clicks" (?e_clicks at Fl@@2HA)
> Debug/MITK.exe : fatal error LNK1120: 4 unresolved externals
> Error executing link.exe.
> 
> In release mode, I am using fltkdll.lib; In debug mode, I am using
> fltkdlld.lib.  Is it right?
> And what about fltk.lib and fltkgl.lib, fltkforms.lib, fltkimages.lib?
> 
> Thanks in advance!
> 



--------------070207000104080604060207
Content-Type: text/plain;
 name="CMakeLists.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="CMakeLists.txt"


PROJECT( ApplicationModel )



#
#  FIND ITK
#
FIND_PACKAGE(ITK)
IF (USE_ITK_FILE)
  INCLUDE (${USE_ITK_FILE})
ELSE (USE_ITK_FILE)
  MESSAGE( FATAL_ERROR "This application requires ITK. One of these components is missing. Please verify configuration")
ENDIF (USE_ITK_FILE)


#
# FIND VTK
#
FIND_PACKAGE(VTK)
IF (USE_VTK_FILE)
  INCLUDE (${USE_VTK_FILE})
ELSE (USE_VTK_FILE)
  MESSAGE( FATAL_ERROR "This application requires VTK. One of these components is missing. Please verify configuration")
ENDIF (USE_VTK_FILE)



#
# FIND FLTK
#
FIND_PACKAGE(FLTK)
IF (FLTK_FOUND)
  INCLUDE_DIRECTORIES (${FLTK_INCLUDE_DIR})
ELSE (FLTK_FOUND)
  MESSAGE( FATAL_ERROR "This application requires FLTK. One of these components is missing. Please verify configuration")
ENDIF (FLTK_FOUND)


INCLUDE_DIRECTORIES(
  ${ApplicationModel_SOURCE_DIR}
  )

#
#  Define the list of source files
#
SET(APPLICATION_SOURCES
  DicomImageReaderBase.cxx
  RegistrationCTBase.cxx
  ImageSliceViewer.cxx
  ApplicationBase.cxx
  Application.cxx
  vtkFlRenderWindowInteractor.cxx
  InteractorObserver.cxx
  )


ADD_LIBRARY(ApplicationModel ${APPLICATION_SOURCES})

FLTK_WRAP_UI(ApplicationModel 
  ApplicationGUI.fl 
  DicomImageReaderGUI.fl
  RegistrationCTGUI.fl
  )

ADD_EXECUTABLE( ApplicationPrototype main.cxx )


TARGET_LINK_LIBRARIES( ApplicationModel
    ITKIO ITKBasicFilters ITKNumerics ITKCommon 
    vtkRendering vtkGraphics vtkHybrid vtkImaging 
    vtkIO vtkFiltering vtkCommon 
    ${FLTK_LIBRARIES}
    )


TARGET_LINK_LIBRARIES( ApplicationPrototype
    ApplicationModel
    )


--------------070207000104080604060207--