openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] Re: Help with Error


From: Paul Schneider
Subject: [Openexr-devel] Re: Help with Error
Date: Mon, 3 Feb 2003 09:32:00 -0800


Hi, Richard,

your mistake was commenting out the #ifdef __MWERKS__ code. Metrowerks needs the definition of templates included in each translation unit.

__MWERKS__ is automatically defined by the Metrowerks C++ compiler (to the version of the compiler). That's why we use that symbol to detect if we're being compiled under CodeWarrior.

I bet you're seeing redefinition because you have the .C files for the various attribute classes included in your project as well. Either remove them from the project (any file that includes the .h file will include the .C files as well), or put include guards around the .C file.

It's possible that the ISO C++ Template Parser removes the need for this - I've never used that option. I'll investigate that further. I also have not needed the C99 extensions to build the EXR code with CodeWarrior.

I'm going to post a working CodeWarrior project this week - others working on a similar project might want to hold off if they're experiencing errors.

Let me just take this opportunity to ask everyone to post development-related questions to this list (address@hidden), rather than sending me email directly. I'm happy to answer questions, but there are many more helpful people on the list.

Thanks!
Paul



On Saturday, February 1, 2003, at 05:45 PM, Richard Patterson wrote:

I am not that fluent in C++ and am probably in way over my head, but I seem frustratingly close to being able to compile and run portions of the OpenEXR code in my application. I am getting only seven errors all similar to the
following:

Error   : function call '[const
Imf::TypedAttribute<Imath::Vec2<float>>].write({lval}
std::basic_ostream<char, std::char_traits<char>>, {lval} const
Imath::Vec2<float>)' does not match
'Imf::Xdr::write<...>(__T1 &, const char *)'
'Imf::Xdr::write<...>(__T1 &, const char *, int)'
'Imf::Xdr::write<...>(__T1 &, half)'
'Imf::Xdr::write<...>(__T1 &, double)'
'Imf::Xdr::write<...>(__T1 &, float)'
'Imf::Xdr::write<...>(__T1 &, unsigned long)'
'Imf::Xdr::write<...>(__T1 &, long)'
'Imf::Xdr::write<...>(__T1 &, unsigned int)'
'Imf::Xdr::write<...>(__T1 &, int)'
'Imf::Xdr::write<...>(__T1 &, unsigned short)'
'Imf::Xdr::write<...>(__T1 &, short)'
'Imf::Xdr::write<...>(__T1 &, unsigned char)'
'Imf::Xdr::write<...>(__T1 &, signed char)'
'Imf::Xdr::write<...>(__T1 &, char)'
'Imf::Xdr::write<...>(__T1 &, bool)'
 (instantiating:
'Imf::TypedAttribute<Imath::Vec2<float>>::writeValueTo(std::basic_ostre am<ch
ar, std::char_traits<char>> &, int) const')
ImfAttribute.h line 311   Xdr::write <StreamIO> (os, _value);

The others are essentially identical for other types of attributes:

(instantiating:
'Imf::TypedAttribute<Imf::LineOrder>::readValueFrom(std::basic_istream< char,
std::char_traits<char>> &, int, int)')
(instantiating:
'Imf::TypedAttribute<Imf::Compression>::readValueFrom(std::basic_istrea m<cha
r, std::char_traits<char>> &, int, int)')
(instantiating:
'Imf::TypedAttribute<Imf::ChannelList>::writeValueTo(std::basic_ostream <char
, std::char_traits<char>> &, int) const')
(instantiating:
'Imf::TypedAttribute<Imf::ChannelList>::readValueFrom(std::basic_istrea m<cha
r, std::char_traits<char>> &, int, int)')
(instantiating:
'Imf::TypedAttribute<Imath::Box<Imath::Vec2<int>>>::writeValueTo(std::b asic_
ostream<char, std::char_traits<char>> &, int) const')
(instantiating:
'Imf::TypedAttribute<Imath::Box<Imath::Vec2<int>>>::readValueFrom(std:: basic
_istream<char, std::char_traits<char>> &, int, int)')

Is there some obvious reason why the way I have my compiler setup can not properly interpret the templates involved here? I have tinkered with the code only minimally. I found I had to comment out the #include statements
of the following variety in order to avoid redefinitions:
// Metrowerks compiler wants the .cpp file inlined, too
#ifdef __MWERKS__
#include <ImfVecAttribute.cpp>
#endif
Is this related to the error I am getting? I tried just eliminating the ifdef and endif since I wasn't sure where _MWERKS_ would get defined in my
project but that didn't seem to make any difference.

I am obviously groping around in the dark, but I keep hoping I am going to stumble onto the solution that will at least let me get inside the code and step through it so that I can see what it is doing. All the programming I know I have learned through this kind of headbanging and I remain hopeful that I can crack this with the same level of persistence...BUT it would sure
be nice to have a helping hand.

Thanks.

 --
Richard Patterson

135 Medio Drive
Los Angeles, CA 90049
310 472-8065
Fax: 310 472-8303
address@hidden

Illusion Arts
6700 Valjean Avenue
Van Nuys, CA 91406
(818) 901-1077
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]