On Tue, Nov 30, 2010 at 04:08:28PM -0800, Art Olin wrote:
> Hi, Michal,

Hi,

> I get the following compilation error when I compile the kernel using 
> g++ (GCC) 3.4.6 20060404. Is it from this rather old compiler or a 
> problem in the code? Thanks.

Yes, I think that this is a compiler issue. See bellow:

> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[sigh, nice and understandable, isn't it - You gotta love templates]

> g++ -c  -O2   -fmessage-length=0 -D_FORTIFY_SOURCE=2 
> -fno-strict-aliasing -fexceptions    -pipe -posix -ansi -std=c++98 
> -pedantic -I. -I/home/olin/download/pdfedit-0.4.5/src 
> -I/home/olin/download/pdfedit-0.4.5/src/xpdf/  -I/usr/include 
> -I/usr/include/freetype2  -I/usr/include -o cpdf.o cpdf.cc
> cpagecontents.cc: In member function `void 
> pdfobjects::CPageContents::addInlineImage(const std::vector<char, 
> std::allocator<char> >&, const libs::Point&, const libs::Point&)':
> cpagecontents.cc:543: warning: passing `const libs::Coordinate' for 
> converting 1 of `pdfobjects::CObjectSimple<Tp>::CObjectSimple(const 
> typename pdfobjects::PropertyTraitSimple<T>::value&) [with 
> pdfobjects::PropertyType Tp =  pInt]'

CInt is CObjectSimple<pInt> (which inherits from  noncopyable, public IProperty)
CObjectSimple<pInt> constructor takes (const PropertyTraitSimple<pInt>::value & 
val)
where value is typedef to int while Coordinate is typedef to double.
This shouldn't be a problem because double should be cast to int
implicitly.

There is one more constructor with a single parameter (CObjectSimple(const 
Object& o))
but Object doesn't have any constructor that could be implicitly or
explicitly cast from double.

> cpagecontents.cc: In copy constructor `pdfobjects::CObjectSimple< 
> pInt>::CObjectSimple(const pdfobjects::CObjectSimple< pInt>&)':
> /usr/include/boost/noncopyable.hpp:27: error: 
> `boost::noncopyable_::noncopyable::noncopyable(const 
> boost::noncopyable_::noncopyable&)' is private
> cpagecontents.cc:543: error: within this context

The code is:
CDict image_dict;
image_dict.addProperty ("W", CInt (image_size.x));

and 
CDict::addProperty (const std::string& propertyName, const IProperty& newIp);

the compiler is complaining about the copy constructor being used here
which is not allowed from CInt definition (inheritance from noncopyable)
but the copy constructor must not be used as addProperty takes const
reference to the object and not the object directly.

The problem is probably caused by the bad constructor inference 
above.

Does the explicit cast helps here:
image_dict.addProperty ("W", CInt ((CInt::value)image_size.x));

If it doesn't help then something like
CInt x(image_size.x);
image_dict.addProperty ("W", x);

should help here.

Anyway c++ implementation in gcc evolves and I wouldn't suggest using
3.4.x anymore. I cannot find g++ package for 3.4 in Debian
stable/testing/unstable repositories so I guess it got obsolete.

Regards
-- 
Michal Hocko

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Pdfedit-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdfedit-support

Reply via email to