LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2013, 10:56 AM   #1
joshp
LQ Newbie
 
Registered: Aug 2006
Location: Chicago IL
Distribution: To many to list.
Posts: 27

Rep: Reputation: 1
Gcc Version Compatibility


Hey all,

What are the chances of a program that is compiled on gcc 4.7.x working on a system that has gcc 4.4.6?

To put it another way, if I have software that was built using gcc 4.7.x, would it work on a SL 6.1 install?

Josh
 
Old 02-07-2013, 11:31 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
A gcc 4.7.x compiled program may depend on libgcc_s.so.1 from gcc-4.7.x.

And if the program was compiled on an OS with a later glibc,
it may depend on objects from that glibc, i.e. libc.so.6
.
A way of testing : Copy the program executable to SL 6,
and run $ ldd <executable> : If nothing is missing, it's OK.

-
 
Old 02-07-2013, 12:41 PM   #3
joshp
LQ Newbie
 
Registered: Aug 2006
Location: Chicago IL
Distribution: To many to list.
Posts: 27

Original Poster
Rep: Reputation: 1
Thank you, was thinking in that direction. I am assuming that this would also apply to a C++ program as well?
 
Old 02-07-2013, 02:51 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 3

Any program that is compiled with gcc, g++.

But why not just recompile on the target OS ?
 
Old 02-07-2013, 03:07 PM   #5
joshp
LQ Newbie
 
Registered: Aug 2006
Location: Chicago IL
Distribution: To many to list.
Posts: 27

Original Poster
Rep: Reputation: 1
Long story short, our devs are using gcc 4.7.x and our production isn't.
 
Old 02-07-2013, 03:18 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You could also get around the problem by compiling with static libraries.
 
Old 02-07-2013, 03:28 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 5
Quote:
our devs are using gcc 4.7.x and our production isn't
The gcc version isn't important ( usually ).
Most programs will compile with any gcc version 3.4.6 ... 4.x.x.
But there are of course exceptions.
 
  


Reply



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
[SOLVED] Whats the difference with gcc 4.5.2-8ubuntu and gcc 4.5.2 generic version Arcosanti Ubuntu 4 08-19-2012 11:05 PM
Determining GCC, binutils and libc version compatibility dar_beh_dar Linux - Software 5 04-05-2010 11:14 PM
Regarding distribution + kernel version + gcc version + glib version. JCipriani Linux - General 8 04-19-2008 02:54 PM
Compatibility between gcc and gcc-lib rajesht Red Hat 1 06-01-2005 12:28 PM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 12:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:39 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
Open Source Consulting | Domain Registration