[Insight-users] can't build (ITK) hello world

Luis Ibanez luis.ibanez at kitware.com
Fri Apr 25 21:04:24 EDT 2008


Hi John,

Not many ideas so far...


at this point the only suspicious observation is:

 > 6:
 > There are many symbols defined, but I did notice that nm complains
 > about one of the .o files in the archive:
 > nm: itkTransformFactoryBase.o: File format not recognized


I assume that you build ITK with REVIEW ON
and with the option for using TRANSFORM FACTORIES ON.

Is that right ?


When you built ITK, did it when smoothly ?
did you got any warnings or error messages during the
build process ?

For lack of any other hits,
I would suggest you to try a clean build of ITK.

and then

a) build the HelloWorld example against the
    ITK build tree (not the installed one)

b) install ITK again,
    then build the HelloWorld example against
    the newly installed ITK



   Please let us know what you find,


     Thanks


        Luis


------------------
John Dailey wrote:
> 3:
> /usr/bin/c++ for both builds
> 
> 5:
> $ ld --version
> GNU ld (GNU Binutils for Ubuntu) 2.18
> Copyright 2007 Free Software Foundation, Inc.
> 
> 6:
> There are many symbols defined, but I did notice that nm complains
> about one of the .o files in the archive:
> nm: itkTransformFactoryBase.o: File format not recognized
> 
> Any ideas?
> 
> Thanks,
> John
> 
> On Fri, Apr 25, 2008 at 4:05 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> 
>> Hi John,
>>
>> Thanks for the quick response and
>> the detailed answer.
>>
>> 1) The size looks right,
>>   what I see in my Ubuntu build for ITK-3-6
>>   is 4,633,530 (which is close enough).
>>
>> 2) Your read permissions look right
>>
>> 3) The simplest way is to look at the
>>   CMakeCache.txt files of both your
>>   ITK-3-6 build and your HelloWorld build.
>>   search for "CMAKE_CXX_COMPILER"
>>
>> 4) The versions look fine.
>>
>>
>> Additional things to check:
>>
>>
>>   Since the original message said that ld
>>   couldn't read the symbols... please do
>>   the following:
>>
>>
>> 5) check what version of "ld" you are using.
>>   ld --version
>>
>> 6) use nm on the library, just to check if
>>   you see a list of symbols. The command
>>   will be:
>>
>>    nm -C /usr/local/lib/InsightToolkit/libITKCommon.a
>>
>>
>>
>> Please let us know what you find,
>>
>>
>>
>>
>>    Thanks
>>
>>
>>       Luis
>>
>>
>>
>>
>> -----------------
>> John Dailey wrote:
>>
>>
>>>1:
>>>$ ls -l /usr/local/lib/InsightToolkit/libITKCommon.a
>>>-rw-r--r-- 1 root root 4694016 2008-04-18 13:49
>>>/usr/local/lib/InsightToolkit/libITKCommon.a
>>>
>>>
>>>2:
>>>global read access
>>>
>>>3:
>>>How do I check? I used ccmake;make for both...
>>>
>>>4:
>>>ITK 3.6.0
>>>$ ccmake --version
>>>ccmake version 2.4-patch 7
>>>
>>>
>>>Thanks
>>>
>>>On Fri, Apr 25, 2008 at 3:02 PM, Luis Ibanez <luis.ibanez at kitware.com>
>>
>>wrote:
>>
>>>
>>>>Hi John,
>>>>
>>>>Please do the following:
>>>>
>>>>
>>>>1) Check the size of the library with the command:
>>>>
>>>> ls -l /usr/local/lib/InsightToolkit/libITKCommon.a
>>>>
>>>>2) Check also the permissions of the file
>>>> (e.g. make sure that you (as Linux user) has read
>>>> access to that file).
>>>> You probably used root access (or sudo) in order
>>>> to intall ITK in /usr/local/lib
>>>>
>>>>3) Check that you are building the example with the
>>>> exact same gcc compiler that you used for building ITK.
>>>>
>>>>
>>>>4) Please let us know what version of ITK and what
>>>> version of CMake you are using.
>>>>
>>>>
>>>>Please post to the list what you find from looking
>>>>at the points listed above.
>>>>
>>>>
>>>>  Thanks
>>>>
>>>>
>>>>      Luis
>>>>
>>>>
>>>>
>>>>-----------------
>>>>John Dailey wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>>Hi,
>>>>>
>>>>>I am a brand new ITK user.  I am working on a 64 bit linux (Ubuntu
>>>>>7.10) box and I am having a problem with linking the hello world
>>>>>application that is in the itkSofwareGuide-2.4.0 on page 17.
>>>>>
>>>>>When I try to compile I get the following error message:
>>>>>
>>>>>[100%] Building CXX object CMakeFiles/HelloWorld.dir/HelloWorld.o
>>>>>Linking CXX executable HelloWorld
>>>>>/usr/local/lib/InsightToolkit/libITKCommon.a: could not read symbols:
>>>>>
>>>>
>>>>Success
>>>>
>>>>
>>>>
>>>>>collect2: ld returned 1 exit status
>>>>>make[2]: *** [HelloWorld] Error 1
>>>>>make[1]: *** [CMakeFiles/HelloWorld.dir/all] Error 2
>>>>>make: *** [all] Error 2
>>>>>
>>>>>Does this mean that I have a problem with my ITK build?  Any ideas as
>>>>>to what might have gone wrong, and how to fix it?
>>>>>
>>>>>Thanks,
>>>>>John
>>>>>_______________________________________________
>>>>>Insight-users mailing list
>>>>>Insight-users at itk.org
>>>>>http://www.itk.org/mailman/listinfo/insight-users
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
> 


More information about the Insight-users mailing list