[Insight-users] Linking problem on Solaris

Luis Ibanez luis.ibanez at kitware.com
Mon, 22 Mar 2004 18:59:30 -0500


Hi Steve,


Thanks for trying the Examples and Tests.

ITK Builds fine with Gcc 3.3.

Therefore the suspects now are:

  1) A wrongly installed gcc 3.3.2

  2) A configuration problem


About (1) Have you used this gcc 3.3.2 in your
system for building any other project successfully ?

In other words,
       Do you trust this compiler in your system ?



About (2) Did you setup the environment variables
CC and CXX ? please check their values with
echo $CC and echo $CXX. They must be pointing
to gcc and g++ respectively (and both for the
same Gcc version = 3.3.2).


These two environment variable must be set before
you run CMake in order to configure your project.

You may want to try removing the binary directory
where you build ITK and reconfiguring from scratch
by making sure that you define CC and CXX first.


Please let us know what you find,



    Thanks


      Luis




----------------------
Steve Boyd wrote:

> Hi Luis,
> 
> I hadn't tried to build the ITK Examples or Testing directories, but
> based on your comments I thought I should try.  Again, these seem to
> fail at the linking stage as per the errors below.
> 
> I'm using g++ 3.3.2, and the latest (updated today) cvs version of ITK. 
> Any ideas?  It seems that it is not a problem associated with my own
> project.  The problems always seem to be something related to vnl
> though... although this may be a fluke.  Perhaps I should use an older
> version of g++????
> 
> Sincerely,
> 
> Steve
> 
> Linking Errors:
> 
> /local/pack/Insight/Examples/Iterators: building default_target
> `cmake.depends' is up to date.
> `cmake.check_depends' is up to date.
> `cmake.depends' is up to date.
> Building executable
> /local/pack/Insight/bin/ImageLinearIteratorWithIndex...
> Undefined                       first referenced
>  symbol                             in file
> MET_Read(std::basic_istream<char, std::char_traits<char> >&,
> std::vector<MET_Fie
> ldRecordType*, std::allocator<MET_FieldRecordType*> >*, char,
> bool)/local/pack/I
> nsight/bin/libITKMetaIO.so
> vnl_c_vector<unsigned long>::max_value(unsigned long const*,
> unsigned)/local/pac
> k/Insight/bin/libitkvnl.so
> MET_ImageModalityToString(MET_ImageModalityEnumType,
> char*)/local/pack/Insight/b
> in/libITKMetaIO.so
> vnl_bignum::vnl_bignum[in-charge]() /local/pack/Insight/bin/libitkvnl.so
> vnl_bignum::vnl_bignum[in-charge](double)/local/pack/Insight/bin/libitkvnl.so
> vnl_matrix<double>::assert_finite_internal()
> const/local/pack/Insight/bin/libitk
> vnl_algo.so
> vnl_bignum::vnl_bignum[in-charge](int)/local/pack/Insight/bin/libitkvnl.so
> 
> 
> Luis Ibanez wrote:
> 
>>Hi Steven,
>>
>>Did you experienced any linking problems
>>when building the Examples in ITK or the
>>Testing directories ?
>>
>>Or are these linking errors produced only
>>in your own registration application ?
>>
>>One typical suspect is that you may have
>>multiple versions of ITK in your Solaris
>>system, and be using header from one version
>>with shared libraries from another version.
>>
>>A look at you CMakeCache.txt and Makefile
>>files may probe to be useful...
>>
>>Open them with any text editor and check for
>>the paths used for ITK headers and ITK libraries.
>>
>>Another typical suspect is that you may have
>>updated your ITK version but not rebuilded it
>>completly (e.g. rebuild only some directories).
>>
>>   Regards,
>>
>>     Luis
>>
>>--------------------
>>Steven Boyd wrote:
>>
>>
>>>Hi,
>>>
>>>I've built my ITK registration project successfully under windows and
>>>linux without problems, but the exact set-up on my new Solaris 5.8
>>>workstation has problems at the linking stage.  I'm using GNU compilers
>>>(3.3.2), the latest version of ITK (cvs) and CMake 1.8.3.
>>>
>>>Although I don't need to link against all the ITK libraries for my
>>>application, I tried to solve the problem by linking against them all on
>>>the solaris build (TARGET_LINK_LIBRARIES).  To no avail...
>>>
>>>Does anybody have an idea what I could be doing wrong??  A tidbit from
>>>the linking errors (which were very long) are included below.
>>>
>>>Cheers,
>>>
>>>Steve
>>>
>>>-----------------------------------------------------------
>>>Undefined                       first referenced
>>> symbol                             in file
>>>__1cDstdObasic_ofstream4Ccn0ALchar_traits4Cc___His_open6M_b_
>>>/local/stow/itk-cvs/lib/InsightToolkit/libITKMetaIO.so
>>>__1cKvnl_matrix4Cd_2t6Mrk0dnLvnl_tag_sub__v_
>>>/local/stow/itk-cvs/lib/InsightToolkit/libitkvnl.so
>>>vnl_fft_gpfa(float*, float*, float const*, int, int, int, int, int, int
>>>const*, int*)/local/stow/itk-cvs/lib/InsightToolkit/li
>>>bitkvnl_algo.so
>>>__1cG__CrunMex_rethrow_q6F_v_
>>>/local/stow/itk-cvs/lib/InsightToolkit/libITKDICOMParser.so
>>>
> 
>