Re: gcc (g++ v3.2.2) trouble

From: Muli Ben-Yehuda (mulix_at_nonexisting.hamakor.org.il)
Date: Tue 23 Mar 2004 - 18:29:52 IST


On Tue, Mar 23, 2004 at 06:06:28PM +0200, Alexander V. Karelin wrote:

> when linking code compiled with g++ 3.2.2 with a library that has been
> compiled with gcc 2.x.x, the linker fails finding references.

There is no C++ binary ABI between gcc 2.xx releases and gcc 3.xx
releases. In other words, this is not a bug, it's a feature. Or at
least a documented bug.

> Now... The problem is that the library in question, if compiled from
> scratch (it's
> the libodbc++) with g++ 3.2.2 fails compilation. I've tried looking for
> some sort of explanation for this phenomena but with no luck so far. Any
> help would be appreciated! Thank You!

The proper thing to do is to fix the library to compile with g++
3.2.2., I'm afraid.

For more on C++ ABI, see
http://www.gnu.org/software/gcc/bugs.html#nonbugs_cxx. Reading it
again, I see it's even worse - there's no ABI compatibility between
*any* g++ major releases. Quoting from the above URL:

"If you change your compiler to a different major release you must
recompile all libraries that contain C++ code."

Cheers,
Muli

-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/

=================================================================
To unsubscribe, send mail to linux-il-request_at_linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request_at_linux.org.il




This archive was generated by hypermail 2.1.7 : Tue 23 Mar 2004 - 18:42:07 IST