McGregor80
Posts: 40
Joined: Wed Feb 20, 2013 10:35 am

c code::[email protected] x86 to Raspberry PI

Tue Mar 19, 2013 6:04 pm

Hi there,

Can someone help me with configuration of code:blocks on my Ubuntu so i can compile, build and somehow export to my raspberry Pi which is on the same local network.

Current progress:

1. I installed code::blocks 10.05 from Ubuntu Software Center (i've seen on codeblocks webpage that there is v 12.11 but i dont know how to download it and install if it's not in the Software Center ).

2. I installed from Ubuntu Software Center "gcc-arm-linux-gnueabi" (I don't know what is the difference between this and the "gcc-arm-linux-gnueabihf")

3. I installed from Ubuntu Software Center "arm-linux-gnueabi-gcc-4.6".

4. I start Code::blocks and start new ARM project. Write some simple test code.
Settings->Compiller and debugger settings-> here i select GNU GCC ARM compiler but the code blocks can't find the settings automatically.

Questions:
5. What settings i should apply manually to make it running:
* Compilers Installation directory ??? (maybe this will be enough so the rest will pop up automatically)
* C compiler
* C++ compiler
* Linker for dynamic libraries
* Linker for static Libraries
* debugger
* resource compiler
* make

6. How to easly save the executable file to the Raspberry Pi and start there?
I guess this might be quite complicated but give me some tips so i can google


thanks in advance for any help.
Gregor

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: c code::[email protected] x86 to Raspberry PI

Sat Mar 23, 2013 6:36 pm

McGregor80 wrote:2. I installed from Ubuntu Software Center "gcc-arm-linux-gnueabi" (I don't know what is the difference between this and the "gcc-arm-linux-gnueabihf")
...
6. How to easly save the executable file to the Raspberry Pi and start there?
I guess this might be quite complicated but give me some tips so i can google
No experience in Code::Blocks unfortunately...

2. The difference is the target binary format: first one for soft-float and second for hard-float (=hf) - so depends on what OS distribution you have on your RPi

6. Would need to have both computers on the same network and 'map network drive' so that the x86 box can see a directory on RPi ...
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

McGregor80
Posts: 40
Joined: Wed Feb 20, 2013 10:35 am

Re: c code::[email protected] x86 to Raspberry PI

Sun Mar 24, 2013 8:28 am

Thanks.
I'm still not there.
I don't know how to configure codeblocks to compile.
It's not finding automatically the files for compiler, linker, etc and i don't know what to set up manually.

Is there anyone who can help me with this one. please

McGregor80
Posts: 40
Joined: Wed Feb 20, 2013 10:35 am

Re: c code::[email protected] x86 to Raspberry PI

Sun Mar 24, 2013 10:35 pm

Finally some progress. I manage to install git and the compiler works.

Here is what i did for these amateurs who will have similar problem:
sudo apt-get install git
git clone git://github.com/raspberrypi/tools.git
sudo apt-get install gcc-arm-linux-gnueabi make ncurses-dev

However when i try to build the file i get:
arm-linux-gnueabi-gcc-4.6 -Wall -g -O2 -fno-common -mcpu=arm7tdmi -DARM_EVAL7T -D__NO_CTOR_DTOR_SUPPORT__ -DUSE_IRQ -g -Isrc -Ih -I/usr/include -c src/vectors.S -o default/src/vectors.o
arm-linux-gnueabi-cpp-4.6 -L/usr/lib -o default/armed.elf default/src/main.o default/src/vectors.o -s -Wl,-Map,map.txt -mcpu=arm7tdmi
cc1: error: output filename specified twice
Any advice?
Thanks in advence

McGregor80
Posts: 40
Joined: Wed Feb 20, 2013 10:35 am

Re: c code::[email protected] x86 to Raspberry PI

Mon Jun 24, 2013 2:14 pm

For all you who had similar problems or want to easy start with compiling from linux.

Install ubuntu 12.10 (or higher) and in the ubuntu software center download/install "arm-linux-gnueabi-gcc-4.7".
This is cross compilator which works for Rapsberry Pi without any other configuration.

just compile and copy to your Pi (Maybe with scp command).

Good luck

RoyLongbottom
Posts: 304
Joined: Fri Apr 12, 2013 9:27 am
Location: Essex, UK
Contact: Website

Re: c code::[email protected] x86 to Raspberry PI

Mon Jun 24, 2013 8:32 pm

The following cross compiler worked for me (via Ubuntu 12.04), except I could not set the path:

http://www.xappsoftware.com/wordpress/2 ... pberry-pi/

I ended up by including the path as part of the compile compile command:

~/toolchain/raspbian-toolchain-gcc-4.7.2-linux32/bin/arm-linux-gnueabihf-gcc

Later I compiled the programs on the RPi (using normal gcc and cc commands). Longest compile time was 36 seconds for 2500 lines of code. Details of my programs are in:

http://www.roylongbottom.org.uk/Raspber ... hmarks.htm

Return to “General programming discussion”