Solved

gcc-c++-4.1.2 on Centos 7

Posted on 2014-10-15
16
750 Views
Last Modified: 2014-10-20
Hi, i would like gcc-c++ to work on centos 7 , i have tried to find rpm's, but can't . can you please help
0
Comment
Question by:zen shaw
  • 7
  • 7
  • 2
16 Comments
 
LVL 61

Expert Comment

by:gheist
ID: 40383208
Nobody can prevent you from re-building RHEL5 source RPM of gcc 4.1.2 on CentOS7
Resurrecting a dinosaur would be more sane idea though.

Install gcc-c++ v4.8.2 instead and fix the code warnings - that had to be done some other day anyway.
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40383220
You would need to compile it from source, you have a working C compiler installed on your CentOS machine, right?

Source for gcc-c++-4.1.2 is here: https://www.gnu.org/software/gcc/releases.html

Installation/building instructions here: https://gcc.gnu.org/install/
0
 
LVL 61

Expert Comment

by:gheist
ID: 40383235
you can use CentOS5 yum-utils
run yumdownloader --source --resolve gcc-c++
And you have source to build
or at least add --prefix=/opt/old_cruft when running ./configure
0
 

Author Comment

by:zen shaw
ID: 40383248
Hi gheist, it's very kind of you for replying.

would it effect if i

compile from source and install 4.1.2 and also, i keep gcc-4.8.2 as well.
basically, my question is, can both versions be kept, yes or no?

if yes, how would they effect it ?
0
 

Author Comment

by:zen shaw
ID: 40383249
one of developer wants to install gc4.1.2 on centos 7, so i'm not sure, if i need to remove latest version to do so.
0
 

Author Comment

by:zen shaw
ID: 40383252
sorry,if i  am annoying  you guys, how do i check if there is working c compiler installed on centos 7 machine or not?
0
 
LVL 61

Expert Comment

by:gheist
ID: 40383255
touch true.c
cc -o true true.c
./true
0
 
LVL 61

Expert Comment

by:gheist
ID: 40383256
GCC 4.8 gives more sophisticated warnings about common coding mistakes.
It is very very bad idea to use old compiler to conceal them
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 

Author Comment

by:zen shaw
ID: 40383276
basically developers have requested this ,they are using centos6 at the moment and they will be switching to centos7 ,

they want gcc4.1.2 compiler installed on centos 7 distro so that they don't have to update all their code for gcc4.8.x
so that they don't have problem when they switch to centos7

what's the best way to address this issue ?
0
 

Author Comment

by:zen shaw
ID: 40383290
also, when i'll compile them, would i get rpm ?

or what would be the end result of compiled files

please help
0
 
LVL 61

Expert Comment

by:gheist
ID: 40383431
CentOS 6 supplies gcc 4.4.7
They are liars.

Indeed they have to update all the code because GCC 4.8 warnings point to their mistakes, not to wrong compiler.

That should ent the epic story.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40383441
RHEL5 source does not compile with EL7 gcc 4.8, bails out.
Either they update their code or fix gcc 4.1 to build with gcc 4.8
0
 

Author Comment

by:zen shaw
ID: 40385688
what do you mean by fix gcc4.1 to build with gcc 4.8
sorry,if i am asking very basic
0
 

Author Comment

by:zen shaw
ID: 40385721
hi gheist, that sounds good idea, how can they do that ?
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40386032
What we are trying to say is that your developers should adapt their code so it compiles with gcc 4.8

You want to migrate to the latest centos, but not the latest compiler. Your developers will have to adapt eventually, now seems a good time.

You could have both Centos 6 and 7 available to developers for a short period, say 3-6 months to give them some time and then quit with 6.
0
 
LVL 61

Accepted Solution

by:
gheist earned 500 total points
ID: 40386040
Well they are programmers who did not change code in last 10 years. Maybe they forgot their trade.
but GCC 4.1.2 will not compile with GCC 4.8.

You can still run programs compiled on EL5 on EL7

And you can use -W flags to disable failing checks in GCC4.8
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now