[Insight-users] error while linking

Luis Ibanez luis.ibanez@kitware.com
Sat, 08 Mar 2003 19:12:59 -0500


Hi Robin,


1) You are missing to link with "libdl",
    the link line should have a "-ldl".

3) You are missing to link with pthreads
    too.

2) Why wasting time doing things the
    hard way ?

    Avoiding these configuration problems
    is the purpose of CMake...




Regards,


    Luis


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

robin gandhi wrote:
> hi everyone,
>    I have build itk on my system and instead of using
> cmake i am using the old fasion way of compiling
> things using a make file. I have been trying to
> compile the Hello world application but it comes up
> with the following error:
> Also the object file is created but the error occurs
> when it tries to create the executable.
> 
> g++ -g -Wno-deprecated -o Hello HelloWorld.o
> -L/afs/uncc.edu/cs/courses/ITCS6140/rgandhi/itk/bin
> -lITKCommon -lITKAlgorithms -lITKBasicFilters -lITKFEM
> -lITKIO -lITKMetaIO -lITKNumerics -litkpng
> -lITKStatistics -litkzlib -lVXLNumerics
> /afs/uncc.edu/cs/courses/ITCS6140/rgandhi/itk/bin/libITKCommon.a(itkDynamicLoader.o):
> In function `itk::DynamicLoader::OpenLibrary(char
> const *)':
> itkDynamicLoader.o(.text+0xf): undefined reference to
> `dlopen'
> /afs/uncc.edu/cs/courses/ITCS6140/rgandhi/itk/bin/libITKCommon.a(itkDynamicLoader.o):
> In function `itk::DynamicLoader::CloseLibrary(void
> *)':
> itkDynamicLoader.o(.text+0x2f): undefined reference to
> `dlclose'
> /afs/uncc.edu/cs/courses/ITCS6140/rgandhi/itk/bin/libITKCommon.a(itkDynamicLoader.o):
> In function `itk::DynamicLoader::GetSymbolAddress(void
> *, char const *)':
> itkDynamicLoader.o(.text+0x54): undefined reference to
> `dlsym'
> /afs/uncc.edu/cs/courses/ITCS6140/rgandhi/itk/bin/libITKCommon.a(itkDynamicLoader.o):
> In function `itk::DynamicLoader::LastError(void)':
> itkDynamicLoader.o(.text+0x83): undefined reference to
> `dlerror'
> /afs/uncc.edu/cs/courses/ITCS6140/rgandhi/itk/bin/libITKCommon.a(itkMultiThreader.o):
> In function
> `itk::MultiThreader::SingleMethodExecute(void)':
> itkMultiThreader.o(.text+0xa77): undefined reference
> to `pthread_create'
> itkMultiThreader.o(.text+0xc79): undefined reference
> to `pthread_join'
> /afs/uncc.edu/cs/courses/ITCS6140/rgandhi/itk/bin/libITKCommon.a(itkMultiThreader.o):
> In function
> `itk::MultiThreader::MultipleMethodExecute(void)':
> itkMultiThreader.o(.text+0x121b): undefined reference
> to `pthread_create'
> itkMultiThreader.o(.text+0x1295): undefined reference
> to `pthread_join'
> /afs/uncc.edu/cs/courses/ITCS6140/rgandhi/itk/bin/libITKCommon.a(itkMultiThreader.o):
> In function `itk::MultiThreader::SpawnThread(void
> *(*)(void *), void *)':
> itkMultiThreader.o(.text+0x16c3): undefined reference
> to `pthread_create'
> /afs/uncc.edu/cs/courses/ITCS6140/rgandhi/itk/bin/libITKCommon.a(itkMultiThreader.o):
> In function
> `itk::MultiThreader::TerminateThread(int)':
> itkMultiThreader.o(.text+0x181e): undefined reference
> to `pthread_join'
> collect2: ld returned 1 exit status
> make: *** [Hello] Error 1
> 
> 
> Please let me know what I am missing here.
> 
> Thanks,
> --Robin.
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>