LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 05-19-2011, 06:57 PM   #1
Dweeb2010
Member
 
Registered: May 2010
Posts: 33

Rep: Reputation: 1
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.
 
Old 05-20-2011, 02:56 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 669

Rep: Reputation: 134Reputation: 134
Quote:
Originally Posted by Dweeb2010 View Post
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
 
Old 05-21-2011, 12:38 PM   #3
Dweeb2010
Member
 
Registered: May 2010
Posts: 33

Original Poster
Rep: Reputation: 1
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ runtime libraries hs_linux Linux - Newbie 1 12-14-2009 02:46 AM
freeciv2 1.14.2 compiling problem x11 libraries code given in post. please help cjh_ubuntu_user Linux - Newbie 4 09-10-2006 07:27 AM
Problem in using both load time linking and runtime linking durgaprasad_j Linux - General 0 08-01-2006 04:49 AM
Compiling and linking 64bit code fskmh Slackware 0 01-15-2005 08:04 AM
Compiling C code with libraries OldGuru Programming 4 09-18-2004 08:06 PM


All times are GMT -5. The time now is 06:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration