Question

I need to upgrade the Compiler(very old code, from g++ 2.0 to 4.0) for our project. However, our project use some 3rd library(only own the binary). Must I rebuild them with the new compiler, or I can still invoke the old binary directly.

Anyone know about this,please be kind enough to help me.

Thanks

Was it helpful?

Solution

It will not work:

  • g++ 2.0 does not use a standard ABI [1];
  • g++ >=3 use the Itanium ABI [1];
  • there is no option to switch back to the old non-standard ABI [2].

[1] « The GNU C++ compiler uses an industry-standard C++ ABI starting with version 3 » http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html

[2] http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-fabi-version-144

OTHER TIPS

It all depends on how the API of the 3rd party library was defined.

If (for example) memory is allocated within the library and freed in your code implying two version of the C runtime might be used then you'll crash.

So to be sure, you need to study the behavior of all the exported functions. This might not be possible.

I can suggest building tests for all the API functions or considering dropping the 3rd party library altogether.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top