[Insight-users] Linking external libraries?
Luis Ibanez
luis.ibanez@kitware.com
Tue, 05 Nov 2002 10:15:02 -0500
Hi Harri,
The LINK_LIBRARIES command in you CMakeLists.txt
file looks fine. Still the linker seems to be
unhappy with the "read_img" symbol.
Does the "read_img" function belong to your
libbsoft.so library ?
Is it defined somewhere else ?
---
Also, you don't need to set the headers
string.h and stdio.h inside the extern "C"
block.
Is there any reason for placing your header
"rwMRC.h" in the extern "C" block ?
Luis
===============================================
Harri Tapio Jaalinoja wrote:
> Hi all!
>
> I am trying to bring new libraries to my code (based on an ITK example):
>
> extern "C" {
> #include <rwMRC.h>
> #include <string.h>
> #include <stdio.h>
> }
>
> Including rwMRC.h is ok, it seems that I was able to include the headers
> correctly. However, I have so far not managed to import also the
> corresponding libraries. This is my current attempt (in CMakeLists.txt):
>
> LINK_LIBRARIES (
> ITKAlgorithms
> VXLNumerics
> ITKBasicFilters
> ITKCommon
> ITKIO
> /usr/local/bsoft/lib/libbsoft.so
> )
>
> The last item is the library that is still missing:
>
> bWatershed.o: In function `main':
> bWatershed.o(.text+0x2b5): undefined reference to `read_img'
>
> I hope you see what I'm aiming at and can point out the correct way to do
> it :)
>
> Attached are the complete output from make and my CMakeList.txt and
> CMakeCache.txt
> files.
>
> Thanks!
>
> Harri
>