[Xfc-dev] Re: Bit of a compile problem with XFC

Jeff Franks jcfranks at tpg.com.au
Thu Apr 14 02:14:07 CEST 2005


Gareth Fleming wrote:

>Hi Jeff
>
>Sorry for contacting you directly, but I'm having a bit of a problem
>compiling xfc 4.3.0.
>
>When compiling libXFCui/xfc/gtk/colorselection.cc, the compiler bombs
>with the following:
>
>/usr/include/c++/3.3/bits/stl_construct.h: In function `void
>   std::_Construct(_T1*, const _T2&) [with _T1 = Xfc::Gdk::Color, _T2 =
>   Xfc::Gdk::Color]':
>/usr/include/c++/3.3/bits/stl_vector.h:599:   instantiated from `void
>std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp =
>Xfc::Gdk::Color, _Alloc = std::allocator<Xfc::Gdk::Color>]'
>colorselection.cc:88:   instantiated from here
>/usr/include/c++/3.3/bits/stl_construct.h:78: error: no matching
>function for
>   call to `Xfc::Gdk::Color::operator new(unsigned int, void*&)'
>../../../libXFCcore/xfc/trackable.hh:168: error: candidates are: static
>void*
>   Xfc::Trackable::operator new(unsigned int)
>
>(Apologies on the shockingly bad formatting)
>
>I'm no C++er (I'l leave all questions of why then I'm trying to compile
>a C++ gui framework to your imagination), so I'm having problems
>figuring out why the vector can't call the copy constructor on Color.
>
>I'm compiling on Ubuntu Hoary (fresh install) with:
>
>g++ 3.3.5
>libstdc++ 2.0.6
>glib 2.6.3
>gtk+ 2.6.4
>
>  
>
Gareth, XFC wont compile with gcc 3.3.5 because there was a bug in 
stl_construct.h that was fixed in gcc 3.4.0. Two choices, use gcc 3.4.x, 
or easier still if you have root access, in your file 
</usr/include/c++/3.3/bits/stl_construct.h> at line 78 insert a scope 
resolution operator in front of operator new so that it reads:

::new(static_cast<void*>(__p)) _T1(__value);

instead of:

new(static_cast<void*>(__p)) _T1(__value);

and XFC will compile.

Regards,

Jeff.



More information about the Xfc-dev mailing list