Home > Uncategorized > Using a g++ 3.3 library with g++ 4

Using a g++ 3.3 library with g++ 4

There are many incompatibilties between g++ 3.3 and g++ 4:

Here is what I add to my configure.ac to make g++ 4 compatible with g++ 3.3:

###################################
# Using g++ 3.3 library with gcc 4
###################################
if $CXX --version | grep 'g++ (GCC) 4.' > /dev/null; then
    AC_MSG_NOTICE([gcc 4 detected. Adding flags to be compatible with gcc 3.])
    #http://gcc.gnu.org/bugs.html#cxx_rvalbind
    CXXFLAGS="-fno-access-control ${CXXFLAGS}"
    #http://gcc.gnu.org/PR11751
    CXXFLAGS="-fno-strict-aliasing ${CXXFLAGS}"
    #http://gcc.gnu.org/onlinedocs/gcc/Compatibility.html
    CXXFLAGS="-fabi-version=1 ${CXXFLAGS}"
fi
Advertisements
Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: