[Insight-users] accessing and building Itk applications

Luis Ibanez luis.ibanez@kitware.com
Tue, 11 Mar 2003 07:08:43 -0500


Hi Zein,

1) FLTK will add this "d" and the end of libraries
     when you build in debug mode.

     You have to build everything (FLTK+ITK+VTK) for
     debug or everything for release.

     The selection between both building modes is
     made the "Build" menu.

2)  I strongly recomend you to use CMake to configure
     your project. You could do it without CMake but
     will simply be a painful and slow process.
     With a CMakeLists.txt file, it will be much simpler.
     When you write the CMakeLists.txt file, you have
     the command TARGET_LINK_LIBRARIES, this is where
     you add the list of libraries to link with.

     Here is below a skeleton of a typical CMakeLists.txt
     file

FIND_PACKAGE(ITK)
IF(ITK_FOUND)
   INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
   MESSAGE(FATAL_ERROR "ITK not found.  Please set ITK_DIR.")
ENDIF(ITK_FOUND)


# Add the executable with our source file.
ADD_EXECUTABLE(MyExecutable
sourcefile1.cxx
sourcefile2.cxx
sourcefile3.cxx
)

TARGET_LINK_LIBRARIES( MyExecutable
   ITKAlgorithms
   ITKBasicFilters
   ITKNumerics
   VXLNumerics
   ITKIO
   ITKCommon
   )


3) for fltkgld.lib, just add this library to the
    list above in TARGET_LINK_LIBRARIES.



Please let us know if you have further
questions.


Thanks


   Luis



-------------------------------
salah wrote:

 >>
 >>These errors seem to be produced by:
 >>
 >>1) You are linking the Debug library of FLTK
 >>    against a non debug build of the application
 >>    (those are the messages 'already defined')
 >>You are right. But I built fltk by building the project "Demo" as you 
told me.
 >>all libraries are ending with d. I guess it was a debug build. I dont 
actualy know what is the difference and how to build some other way. Is 
my building this way correct? If not, what should I do? Build 
application some other way? or build FLTK some other way? or both?
 >>
 >>2) You are not adding ITKCommon, ITKIO to the
 >>    list of libraries to link with in the
 >>    CMakeLists.txt file of your applications.
 >>   (those are the messages 'unresolved external
 >>    itk::Process... etc)
 >>You are again right. I do not even have CMakeList.txt file in my 
project. Should I have?? How to build this file and how to use it? 
PLEEEEEEASE do not ignore my last message regrding this problem.
 >>
 >>3) You are not linking with the fltk_gl library
 >>    (those are the messages 'unresolved external
 >>     Fl_Gl_Window...)
 >>I realy do not have this library, I have an fltkgld.lib file in the 
\fltk-1.1.3\lib\. I think this is also related with point 1 above. Or?
 >>
 >>
 >>
 >>->8<------------->8<------------->8<------------->8<------------->8<------------->8<-
 >>Zein I. Salah
 >>University of Tübingen, WSI-GRIS, Sand 14, 72076 Tübingen
 >>Email: salah@gris.uni-tuebingen.de
 >>Tel.: (07071) 29 75465 (GRIS),           Fax: (07071) 29 54 66
 >>
 >
 >