OK thanks Larry. I didn't realize gcc 4.1 was so old until I queried the version. I don't need to support this compiler much longer and can update my version of export.h to get it working in the meantime. Thanks again.
Sheila ________________________________ From: [email protected] [[email protected]] on behalf of Larry Gritz [[email protected]] Sent: Tuesday, April 02, 2013 5:04 PM To: OpenImageIO developers Subject: Re: [Oiio-dev] Exporting symbols on linux using __attribute___ (visibility ("default"))) - enum problems Yeah, apparently gcc 4.1 is older than any of the users appear to be currently using, so when the symbol visibility was added, it probably broke compatibility with gcc < 4.2. Do you need it to work with both compilers? I'm sure it would not be very difficult to modify export.h so that it doesn't include that attribute if the compiler is too old, though of course you would end up with all symbols visible. -- lg On Apr 2, 2013, at 5:01 PM, Sheila Santos wrote: I'm using 2. On gcc version 4.1.2 20080704 (Red Hat 4.1.2-44) it fails. With gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) it seems OK. Sheila ________________________________ From: [email protected]<mailto:[email protected]> [[email protected]] on behalf of Larry Gritz [[email protected]] Sent: Tuesday, April 02, 2013 4:53 PM To: OpenImageIO developers Subject: Re: [Oiio-dev] Exporting symbols on linux using __attribute___ (visibility ("default"))) - enum problems What C++ compiler are you using? On Apr 2, 2013, at 4:51 PM, Sheila Santos wrote: Hi everyone, I'm building openimageio on linux. In src/include/export.h, OIIO_API gets set to to __attribute__ ((visibility ("default"))). It seems to work fine for functions and classes, but I get warnings and errors when this is used with enums. For example: imagebufalgo.h:94: warning: type attributes are honored only at type definition imagebufalgo.h:94: error: use of enum ‘AlignedTransform’ without previous declaration imagebufalgo.h:95: error: expected unqualified-id before ‘{’ token code looks like: enum OIIO_API AlignedTransform { TRANSFORM_NONE = 0, TRANSFORM_FLIP, // Upside-down TRANSFORM_FLOP, // Left/Right Mirrored TRANSFORM_FLIPFLOP, // Upside-down + Mirrored (Same as 180 degree rotation) // TRANSFORM_ROT90, // Rotate 90 degrees clockwise. Image remains in positive quadrant. // TRANSFORM_ROT180, // Rotate 180 degrees clockwise. Image remains in positive quadrant. (Same as FlipFlop) // TRANSFORM_ROT270, // Rotate 270 degrees clockwise. Image remains in positive quadrant. }; Is the syntax for ___attribute___ different for enums? Thanks. Sheila _______________________________________________ Oiio-dev mailing list [email protected]<mailto:[email protected]> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org -- Larry Gritz [email protected]<mailto:[email protected]> _______________________________________________ Oiio-dev mailing list [email protected]<mailto:[email protected]> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org -- Larry Gritz [email protected]<mailto:[email protected]>
_______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
