[Insight-users] Re: /usr/bin/ld: cannot find -lITKFltkImageViewer

Luis Ibanez luis . ibanez at kitware . com
Fri, 13 Jun 2003 15:47:32 -0400


Hi Tao,

It looks like you are trying to use the
FltkImageViewer library from your own
application.

There is no problem for doing this,
you simply will need to add some
configuration lines to your CMakeLists.txt
file (in your application).

What happens is that FltkImageViewer is
not officially part of ITK. It is a library
provided in the InsightApplications/Auxiliary
directory with the purpose of facilitating
the development of small applications.

You will have to build the InsightApplications
checkout first, making sure that enable USE_FLTK.
Once you have built InsightApplications, verify
that the file

   libFltkImageViewer.a

exists in the /bin subdirectory of the binary
directory where you built InsightApplications.


In order to use this library you need to let
your application know where the library is,
and where the headers for its classes are.


Adding the following lines to your
CMakeLists.txt file should be enough:



FIND_PATH(InsightApplications_SOURCE_DIR CMakeList.txt)

FIND_PATH(InsightApplications_BINARY_DIR CMakeCache.txt)

INCLUDE_DIRECTORIES (
${InsightApplications_SOURCE_DIR}/Auxiliary/FltkImageViewer
${InsightApplications_BINARY_DIR}/Auxiliary/FltkImageViewer
)

LINK_DIRECTORIES(
${InsightApplications_BINARY_DIR}/Auxiliary/FltkImageViewer
)



Note that you should also have the lines for locating
FLTK, (before the lines shown above).


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


-----------------


Regards,



   Luis



---------------------
Tao Zhu wrote:
> Dear Luis,
> 
> I am working in Linux. I couldnt find TKFltkImageViewer library.
> 
> I noticed the difference itkFltkImageViewer.lib and FltkImageViewer.lib
> but that looks like a lib in Windows.
> 
> The attached is what I got on my screen.
> 
> Please advise.
> 
> Thanks.
> 
> Tao.
> 
> 
> 
> ----------------------------------------------------
> 
> Building dependencies. cmake.depends...
> Building executable /home/zhut/edge/InsightToolkit/MILanBaR/MILanBaR...
> /usr/bin/ld: cannot find -lITKFltkImageViewer
> collect2: ld returned 1 exit status
> make[1]: *** [/home/zhut/edge/InsightToolkit/MILanBaR/MILanBaR] Error 1
> 
>