[vtkusers] Link error building VTK 4.4 on Mac OS 10.4 with gcc 4.0 (but not 3.3)

Sean McBride sean at rogue-research.com
Thu Jun 9 13:07:26 EDT 2005


On 2005-06-09 09:13, Martin Costabel said:

>> Building object file RGrid.o...
>> Building executable /Users/sean/Desktop/vtk/vtk/VTK_gcc4_plain/bin/
>> GraphicsCxxTests...
>> /usr/bin/ld: Undefined symbols:
>> __ZNSt8ios_base4InitC4Ev
>> collect2: ld returned 1 exit status
>
>Looking at the sources, you can find the following gem in 
>Graphics/vtkAppendFilter.cxx and about 2 dozen other source files:
>
>//-----  This hack needed to compile using gcc3 on OSX until new 
>stdc++.dylib
>#ifdef __APPLE_CC__
>extern "C"
>{
>   void oft_initGraphics()
>   {
>   extern void _ZNSt8ios_base4InitC4Ev();
>   _ZNSt8ios_base4InitC4Ev();
>   }
>}
>#endif

It didn't occur to me to search the source for a _mangled_ name! :) 
Nice find.

>This symbol is gcc-3.3 speak for std::ios_base::Init::Init[unified](), 
>absent from gcc-4.0 (which can't even demangle it). So I guess the hack 
>can go now, or at least it should check whether __GNUC__ is 3.

I got the source from cvs and it seems that hack was already removed. 
Alas, there were other build problems with that source, but easy to fix.

I changed 5 files (all minor syntax issues) and would like to submit
them back.  From what I can tell, the proper procedure is to open a bug
and attach my changed files... is this so?

Thanks!

Next.. trying to _use_ vtk. :)

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtkusers mailing list