At a command prompt, type
to view CPU information.
The ARM11 chips use version 6 of the ARM instruction set, ARMv6. More recent chips from the ARM Cortex range like the Cortex A7, A8 etc all use the ARMv7 instruction set.
All Pi boards are shipped with an ARM11. The options on the second line look like a better fit for building ...
Do NOT use nano (or another text editor to put your code into) with root/sudo permissions (ie. do not edit with sudo nano, only use nano) if all you are doing is personal stuff that does not need superuser permissions.
To compile from the command line (assuming yourcode.c is the name of your C file, and program the name of the resulting program ...
That may depend on your distro, but if you are using raspbian, the stock gcc includes g++, here's the version info:
me@RPi» gcc -v
Using built-in specs.
So apt-get install gcc should work if it isn't already there.
Most distros will build gcc with C++ support, so this should be true for them too. The ...
The documentation for GCC is actually contained in its own package1, gcc-doc.
sudo apt-get install gcc-doc
and then man gcc will work as expected.
Note that your attempt, sudo apt-get --reinstall install man gcc asks apt-get to try and install two packages, man and gcc. man doesn't exist as a package in the repositories, and gcc will just be ...
As long as your Raspberry Pi is up to date, then you can just download and patch GCC 4.8 to run on you Raspberry Pi.
Download GCC sources
$ wget ftp://ftp.fu-berlin.de/unix/languages/gcc/snapshots/LATEST-4.8/*.bz2
$ tar xf gcc-4.8-20120826.tar.bz2
We need to get and apply two debian specific patches for GCC:
$ wget http://...
Compiling C programs on the raspberry pi is rather simple. First, create your program in a text editor and save it as <insert name>.c It should be saved on the Desktop.
Next, open terminal. In it type:
This changes the directory that the terminal is looking at to Desktop. This is also where our program is stored.
gcc -Wall <myName>....
The problem is in Putty not the Pi. To fix the problem:
Load the stored profile for the Pi (I assume you have saved you connection details).
Open Putty Configuration.
From the left side menu click Translation from the Window section.
In the Remote character set dropdown select UTF-8.
Make sure that Use Unicode line drawing code points is selected.
Save the ...
Note that when building the toolchain using ct-ng on centos 6.3 on a 64 bit system I was forced to deselect the option to statically link libstdc++ because static linking was not supported on the platform (apparently).
Also, while it would be great to use the prebuilt toolchain from the git repository, that chain does not seem to work on Centos 6.3 - ...
There's a gotcha here created by the lack of specificity with ARM cross-compilers. ARM actually refers to a family or series of instruction sets which are not necessarily compatible with one another.
Currently, by far the most common ARM architecture is ARMv7. This is widely used in mobile devices such as smartphones (including Apple's) and low-power ...
The gcc documentation explains this in detail. Basically, you can tell the compiler to forcibly use armv6:
gcc -march=armv6 -c foo.c -o foo.o
You can also let gcc try to autodetect the current architecture:
gcc -march=native -c foo.c -o foo.o
In case you are going to cross-compile from the OS X : here is the great article (and the only one working on the web I found).
The greatest thing is author provides a complete precompiled toolchain, so you only need to download, unzip and mount dmg image. And thats it, you are ready to cross-compile.
If you want to benefit from a fast host for compiling things for your RPI I suggest to work in cross environment via chroot and QEMU. This by the way supersedes a cross compiler with no hassle.
Simply setup a Debian cross-environment using deboostrap/multistrap
(see chapter QEMU/debootstrap approach) and you are done.
Like @okertanov said, your code has syntax errors. In C, comments must be enclosed /* like this */, strings for printf "have to be in quotes", and newlines are printed with \n inside the quotes.
Try something like this:
The default version of the GCC are as follows:
Raspbian Stretch: GCC 6.3.0
Raspbian Jessie: GCC 4.9.2 (GCC 4.8.4 available)
Raspbian Wheezy: GCC 4.6.3 (GCC 4.4.7 and 4.7.2 available)
g++ always gets the same version number as GCC, since it is part of the same software project.
It's in the Raspbian repository, so you can install it with
sudo apt-get install liblinux-inotify2-perl
Bringing in modules from CPAN can affect the stability of a Debian distribution (they have conflicting policies on file modifications), so I don't recommend it unless you absolutely have to.
gcc-4.6 is the default compiler in Debian 6.0; Raspian is a port of Debian 6.0. It is not the only version available, though. You can install different versions, including 4.7 with apt-get install gcc-4.7.
Now, you said that CPAN modules are compiled with the same version perl was compiled with. It is very possible that perl on Raspbian was compiled with ...
If you installed Ubuntu 64 bits edition and the tools from Raspberry Pi SVN and you are getting the error:
No such file or directory
sudo apt-get install ia32-libs
My interpretation of the Cortex-A7 MPCore ™ is that there is an FPU per core.
In particular section 1.5 of the Technical Reference Manual says the FPU can be configured per core but goes on to say that if the core has NEON the core has an FPU. I believe all the cores have NEON so all have an FPU.
So I figured it out.
I just grabbed the crossbuild version of gcc (I think that is what it is)
sudo apt-get install crossbuild-essential-armhf
And then my new path is:
And the build works perfectly!
If you suspect a hardware problem, try running cpu and RAM tests to confirm it:
sudo apt-get install memtester
I would probably run fsck as well, even though filesystem errors resulting in segfaults are unlikely.
Finally, I would assume that the bug is specific to the compiler and try to install a different version of gcc.
This question is a Unix question, not a Raspberry Pi specific question. The answer you are looking for is here: https://unix.stackexchange.com/questions/13192/what-is-the-difference-between-a-and-so-file. You could have found this easily if you would have googled (3rd hit on the search "what are .so files in linux")
The problem is with your printf line.
you are missing the closing parenthesis ")", You are also missing quotes around the text "Hello World"
change that line to:
Your final code should look like this
You can then compile it with this command:
This is in part a duplicate of these questions:
compilation errors : gtk+-2.0 gthread-2.0 not found
Although since apt has a new, simplified, slightly snazzier interface I'll use the new version here and make the common point more clear.
I know that these include files should have also been installed by apt-get