Questions tagged [gcc]

The GCC (GNU Compiler Collection) is a set of compilers for various high-level languages. Use this tag for questions related to how to install and use the GCC.

64 questions
89
votes
8 answers

How do I build a GCC 4.7 toolchain for cross-compiling?

I already asked this question on Stack Overflow, but I would like to know if anyone managed to build a GCC 4.7 toolchain for ARM cross-compilation (for a x86/x86-64 Linux host). There are many instructions for building GCC from source and many…
user13
36
votes
3 answers

How do I see which ARM CPU version I have?

When compiling a package for the Pi I came across a message like this: CFLAGS += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8 and CFLAGS += -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard I know the difference…
kun
  • 471
  • 1
  • 4
  • 5
31
votes
1 answer

How can I detect that I'm compiling for Raspberry Pi?

As Raspberry Pi needs a bit of special code (I'm talking about C/C++) for accessing some hardware features (e.g. a call to bcm_host_init()). I'm looking for a reliable and elegant way to detect this automatically. I don't think there are any…
Tapio
  • 693
  • 1
  • 6
  • 9
15
votes
4 answers

How can I install GCC 4.8 on the Raspberry Pi?

How can I install GCC 4.8 on Raspberry Pi? Do I need to compile it from source? Should I update from Raspbian wheezy to a newer version?
Ross Rogers
  • 609
  • 3
  • 7
  • 19
11
votes
3 answers

How to install GNU C++ Development Tools on Raspberry Pi (using apt-get)

Is there a well-known package I should install for C++ Development Tools? What do I type at the command-line after sudo apt-get install? Ideally, I want the same tools that were installed with "MinGW" on my Windows computer.
imulsion
  • 771
  • 4
  • 10
  • 19
8
votes
3 answers

How to compile C files in terminal

Question Can someone please tell me how to compile from the command line in a clear, concise way. Preferably, my programs will be written in a real text editor (such as leaf pad). Background I am a complete n00b when it comes to Linux, C, and the…
xxmbabanexx
  • 3,278
  • 7
  • 36
  • 56
6
votes
1 answer

gcc manual not found

I wanted to see gcc's maual but $ man gcc No manual entry for gcc See 'man 7 undocumented' for help when manual pages are not available. $ man gcc-XX No manual entry for gcc-XX $sudo nano /etc/apt/sources.list deb…
SuperPizz
  • 81
  • 5
5
votes
1 answer

AddressSanitizer on Raspbian

I am trying to use AddressSanitizer on Raspbian. I use the following to compile my program: gcc -fsanitize=address -fno-omit-frame-pointer -g prog.c -o prog Even for the simplest program (just a Hello World), I get the following when trying to run…
Szabolcs
  • 662
  • 2
  • 6
  • 18
5
votes
3 answers

What is the gcc and g++ version in Raspberry Pi 2 and 3?

I am reading an article on raspberry pi on a local magazine and they do this sudo apr-get install gcc-4.8 g++-4.8 sudo rm -rf /usr/bin/gcc sudo rm -rf /usr/bin/g++ sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++ I…
KansaiRobot
  • 221
  • 3
  • 10
5
votes
2 answers

Running ARM64 binaries on RP4

I'm trying to run an ARM64 binary on my RP4 with arm_64bit enabled in /boot/config.txt. I get an error: No such file or directory. Running file cloudflared-linux-arm64 I get: cloudflared-linux-arm64: ELF 64-bit LSB executable, ARM aarch64, version 1…
bertday
  • 161
  • 1
  • 6
4
votes
2 answers

What can cause libs to not be found on raspberry pi

On my Raspberry Pi, with Debian Squeeze, I want to link to the shared objects in /opt/vc/lib. I have added this directory to a file in /etc/ld.so.conf.d/ which is included in /etc/ld.so.conf. The compiler/linker runs without error, but upon…
derekdreery
  • 143
  • 1
  • 6
3
votes
1 answer

How to compile project on Raspberry Pi, even when g++'s virtual memory exhausted despide big SWAP?

I want to build Iroha hyperledger on Raspberry Pi 3. So I've downloaded code and all dependencies and compiler gcc-8.2 (downloaded precompiled from here), then configured without tests: cmake -DTESTING=OFF -LA ../ but when I run make: it is…
baziorek
  • 141
  • 3
3
votes
1 answer

Problem with gcc/g++ versions

I'm currently setting up Homebridge to run on my Pi using this installation guide. I have run into a problem regarding the C++ compiler section; I understand that this part of the guide is out of date as the versions in the instructions to not match…
Rocco
  • 133
  • 1
  • 4
3
votes
2 answers

Error while loading shared libraries: foo.so: cannot open shared object file: No such file or directory

I have cross compiled c++ code for raspberry pi. Below is process I followed: 1) Cloned the official toolchain from raspberry pi github. Set the environment variable of arm-linux-gnueabihf-c++ (in .bashrc file). 2) Typed this command for generating…
Aniket Pawar
  • 31
  • 1
  • 6
3
votes
1 answer

Compile GCC for Raspberry Pi 2B - Patches required?

I need to compile a modern version of GCC in order to compile CMake in order to compile OpenCV 3.0.0. So I want to compile a modern and stable version of GCC for the Raspberry Pi 2b. I've read this topic: How can I install GCC 4.8 on the Raspberry…
1
2 3 4 5