A source file compiled with Oracle Developer Studio C++ compiler (CC) needs to be linked using the C++ compiler to make sure if the correct runtime libraries and linker options are used. G++ object files should be linked with the g++ compiler.
Shared libraries created by Oracle Developer Studio CC with the options –compat=g, –std=c++03, –std=c++11, or –std=c++14 can be freely mixed with shared libraries created by the g++ compiler and linked into a main program created by either of these compilers. A binary compiled against a newer version of the gcc library in most instances cannot be linked to an older version of the gcc library.
The Oracle Developer Studio 12.6 C++ compiler in gcc compatible mode uses the 5.4.x version of the g++ runtime library.
You can mix libraries and applications built with different versions of the g++ library, but the compiler used to build and link the main application should be a version at least as recent as the compiler used to create any of the shared libraries. If any shared libraries are built with Oracle Developer Studio C++, the main application should be built either with the Oracle Developer Studio C++ or with a g++ compiler that supports the 5.4.x runtime libraries.