LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Compiling code - linking to libraries using different versions of c++ runtime? (http://www.linuxquestions.org/questions/linux-software-2/compiling-code-linking-to-libraries-using-different-versions-of-c-runtime-881687/)

Dweeb2010 05-19-2011 06:57 PM

Compiling code - linking to libraries using different versions of c++ runtime?
 
Hi. I've gotten myself into a weird situation here and I must admit it has me pretty confused.

Basically, I'm trying to compile program A, which depends on LibA and LibB.

LibA would not build with my version of G++ 4.4.3 due to a bug, so I've compiled the latest G++ 4.5 (installed in /opt directory) and built that library successfully (also installed in /opt).

I have LibB on my system already, but it was built with the 4.4.3 version. When compiling my final program, am I going to have issues because the .so files were built with different versions of gcc/g++? Or should I just rebuild a special version of LibB with the later version of the compiler just for that program? I can proceed and just see what happens, but I'm a little confused about how things work in a situation like this.

Thoughts?

Thanks.

Valery Reznic 05-20-2011 02:56 AM

Quote:

Originally Posted by Dweeb2010 (Post 4361317)
Hi. I've gotten myself into a weird situation here and I must admit it has me pretty confused.

Basically, I'm trying to compile program A, which depends on LibA and LibB.

LibA would not build with my version of G++ 4.4.3 due to a bug, so I've compiled the latest G++ 4.5 (installed in /opt directory) and built that library successfully (also installed in /opt).

I have LibB on my system already, but it was built with the 4.4.3 version. When compiling my final program, am I going to have issues because the .so files were built with different versions of gcc/g++? Or should I just rebuild a special version of LibB with the later version of the compiler just for that program? I can proceed and just see what happens, but I'm a little confused about how things work in a situation like this.

Thoughts?

Thanks.

I think you are better off compiling LibB (and your executable too) with new compiler. For me mixing things compiled with different versions of g++ never worked.
But may be you are lucky

Dweeb2010 05-21-2011 12:38 PM

Thanks! I was able to get the project to build fine without building a separate version of the library, but I've yet to see what kind of effects that's going to have on it when it runs. As soon as I can find out how to get it configured properly, I'm going to build a separate version just for the project to be on the safe side. Thanks again!


All times are GMT -5. The time now is 10:46 PM.