triplus
Posts: 30
Joined: Thu Nov 21, 2013 9:03 pm
Location: Belgium, Vilvoorde
Contact: Website Facebook Twitter YouTube

Compiling and installing gcc 4.8.x

Sun Jan 05, 2014 8:36 pm

Hello

I've been trying to install gcc 4.8.2 on my raspberry, because i need it to compile something else (http://rathena.org/board/topic/78187-ra ... =raspberry)

I have tried many different ways, but i haven't succeeded so far... What i did so far:

-Make a clone from github and run the "make" command. This worked for a while, but then it began to give missing file errors. I tried fixing some of them, but then i noticed i began to change(duplicate) certain files that i don't think should be moved from position.

-I tried crosscompiling with eclipse, but this also gave me missing file errors.

Is there any guide that will work, or can anyone give me good instructions on how to get a working gcc 4.8 on my raspberry?

I don't care if i have to compile on my raspberry since it is on 24/7.

I found many guides on how to get gcc working on ubuntu, but that did not work. Also corsscompiling worked for a simple hello world program (but i did not run it on my raspberry, but at least it didn't give me errors), but for gcc 4.8 it didn't work.

Thanks in advance
Joren C.
- Raspberry Pi Model B since 2013.
- Raspberry Pi Zero since October 2016
- Raspberry Pi 3 since: December 2016

User avatar
DougieLawson
Posts: 32692
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Compiling and installing gcc 4.8.x

Sun Jan 05, 2014 11:04 pm

Update /etc/apt/sources.list to have jessie wherever you've currently got wheezy

sudo apt-get update
sudo apt-get dist-upgrade
sudo rpi-update
reboot

And the stock gcc that gets installed is:
ii gcc 4:4.8.2-1 armhf GNU C compiler
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

triplus
Posts: 30
Joined: Thu Nov 21, 2013 9:03 pm
Location: Belgium, Vilvoorde
Contact: Website Facebook Twitter YouTube

Re: Compiling and installing gcc 4.8.x

Mon Jan 06, 2014 12:39 pm

I never tought of actually upgrading my pi... that seems like the easiest way of doing this. I'm testing this right now, getting the packages ;)

Thanks!
- Raspberry Pi Model B since 2013.
- Raspberry Pi Zero since October 2016
- Raspberry Pi 3 since: December 2016

triplus
Posts: 30
Joined: Thu Nov 21, 2013 9:03 pm
Location: Belgium, Vilvoorde
Contact: Website Facebook Twitter YouTube

Re: Compiling and installing gcc 4.8.x

Mon Jan 06, 2014 2:45 pm

It worked! now onto the next step, thank you!
- Raspberry Pi Model B since 2013.
- Raspberry Pi Zero since October 2016
- Raspberry Pi 3 since: December 2016

zappfinger
Posts: 27
Joined: Tue Nov 26, 2013 7:25 pm

Re: Compiling and installing gcc 4.8.x

Wed Dec 28, 2016 11:15 pm

This does not work for me. I followed the steps but my gcc version stayed the same:

gcc version 4.6.3 (Debian 4.6.3-14+rpi1)

User avatar
kevscott
Posts: 1
Joined: Sun Feb 11, 2018 1:48 pm
Location: Central Scotland
Contact: Website Twitter

Re: Compiling and installing gcc 4.8.x

Sun Feb 11, 2018 1:52 pm

I found that I still had the old compiler after following these steps as well. However, then doing "sudo apt-get install build-essential" got me the latest version of the compiler, which is now 4.9.2 at the time of writing.

jahboater
Posts: 2636
Joined: Wed Feb 04, 2015 6:38 pm

Re: Compiling and installing gcc 4.8.x

Sun Feb 11, 2018 6:32 pm

You have resurrected an old thread ...
kevscott wrote:
Sun Feb 11, 2018 1:52 pm
However, then doing "sudo apt-get install build-essential" got me the latest version of the compiler, which is now 4.9.2 at the time of writing.
The current version of the compiler is 7.3 which I use on all my Pi's.

The pre-installed version is 6.3

So your 4.9.2 is very old

n67
Posts: 691
Joined: Mon Oct 30, 2017 4:55 pm

Re: Compiling and installing gcc 4.8.x

Sun Feb 11, 2018 7:46 pm

jahboater wrote:
Sun Feb 11, 2018 6:32 pm
So your 4.9.2 is very old
It wasn't (old) when this thread was started (and thus relevant):

Sun Jan 05, 2014 8:36 pm
"L'enfer, c'est les autres"

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 14 guests