[Insight-developers] Re: [Insight-users] Building ITK on a Linux box

Brad King brad . king at kitware . com
Mon, 2 Sep 2002 10:11:47 -0400 (EDT)


Mathieu,

> $gcc --version
> gcc (GCC) 3.1.1 (Mandrake Linux 8.3 3.1.1-0.2mdk)
> But I ge this error message:
> c++  -rdynamic -shared -g -O2 -ftemplate-depth-50 -o [snip]
> itkVTKImageIO.o: [snip]
> itkPNGImageIO.o: [snip]

Hmm...A couple things to try:

Check to make sure your c++ and gcc executables are from the same
compiler:  "c++ --version" should be gcc 3.1.1.

Find the .o files itkVTKImageIO and itkPNGImageIO and run

  nm foo.o |c++filt |grep basic_string |grep assign

for foo = itkVTKImageIO and then itkPNGImageIO.  Be sure to use the
version of c++filt that matches the compiler used (check with c++filt
--version).  The output should look something like this:

$ nm itkPNGImageIO.o|c++filt |grep basic_string |grep assign
00000000 W basic_string<char, ... >::assign(char const *)
00000000 W basic_string<char, ... >::assign(char const *, unsigned int)

$ nm itkVTKImageIO.o|c++filt |grep basic_string |grep assign
00000000 W basic_string<char, ... >::assign(char const *)
00000000 W basic_string<char, ... >::assign(char const *, unsigned int)

If you see anything but "W" in the second column, it will explain why the
link is failing.  Then, the question will be why the compiler generated a
non-weak symbol.

> Then I tried  to compile it with gcc2.95.3
> And it works fine. I can build ITK against VTK. But when I change
> VTKITK_WRAP_TCL = ON

This functionality has not been tested in a while, but we just recently
added nightly testing for it.  The problems have not yet been fixed.  You
can see some similar errors on the dashboard for gcc 3.2 at

http://public.kitware.com/dashboard.php?name=itk

-Brad