openexr-devel
[Top][All Lists]
Advanced

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

Re: [Openexr-devel] "Half" support in C?


From: Bob Friesenhahn
Subject: Re: [Openexr-devel] "Half" support in C?
Date: Wed, 2 Mar 2005 16:45:10 -0600 (CST)

On Wed, 2 Mar 2005, Drew Hess wrote:

Bob Friesenhahn <address@hidden> writes:

The typical situation is that it is easy for GCC code to link with
OS/vendor libraries (the normal case).  It is problematic for vendor
compilers to link with libraries build with GCC (even C libraries)
because code built with GCC expects certain support functions
(e.g. _eprintf) to exist.  Adding libgcc to the mix may cause other
problems (e.g. duplicate symbols).

"May," or "has" ?  I find it hard to believe that in practice you'd
encounter code and/or a vendor compiler that has symbol conflicts with
libgcc, given how popular that compiler is.

Has. The libgcc library provides support for important things like static initialization and low-level error reporting which are needed when GCC is used to do the linking. The vendor compiler has its own way of doing things.

What I'm proposing is not that you link a C++ library into your C
code, but that you wrap the C++ library (libHalf, in this case) with a
C library, and then link that C library into your application.  If the
C++ library is statically linked into the C wrapper, I don't think
you'd need a C++-aware linker.

Due to static initialization (including C++ exception related handling) it is risky to not use a C++-aware linker. If there were any statically allocated C++ objects there may also be problems.

Bob
======================================
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/




reply via email to

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