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 ...
Checking at configure/compile time for the features your code depends upon is the way to go. Checking for specific devices is problematic because avoiding false-positives is virtually impossible (someone could lie to you deliberately even with little effort) and the aim of such checks is to answer the question: "can I build here? If yes what code path should ...
I am eager to get compiling and I would like to use the latest and the best tools.
In fact, the latest and best tools do not need to be built by yourself. On the Raspberry Pi Tool GitHub Repository you will find the X86_64 and x686 toolchains for cross-compiling software.
I recommend using the x86-linux64-cross-arm-linux-hardfp toolchain, as that will ...
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 ...
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 - ...
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>....
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://...
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 ...
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
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 ...
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:
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.
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.
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
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 ...
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")
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.
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.