Hi.
Is there any possibility to write programs for raspberry from PC?
I mean C++ here.
Just to clarify - I'd like to write code once, instead of doing changes on raspberry later on (If possible). And is it possible to compile from PC using GNU compiler for ARMv6 raspberry? (Instead of compiling the whole thing on raspberry itself)
Writing for raspberry from PC?
My site
http://www.motionstruct.com
http://www.motionstruct.com
Re: Writing for raspberry from PC?
It should be.
I compile for soft float on a (Linux) PC. Google for raspberry pi cross-compiler. I think the tool-chain for cross-compiling hard float is harder to set up - but I haven't tried recently.
I compile for soft float on a (Linux) PC. Google for raspberry pi cross-compiler. I think the tool-chain for cross-compiling hard float is harder to set up - but I haven't tried recently.
Re: Writing for raspberry from PC?
The only problem is with creating a window I suppose.
On linux it's X11 I guess, while on pi it's something else.
That's the biggest pain.
On linux it's X11 I guess, while on pi it's something else.
That's the biggest pain.
My site
http://www.motionstruct.com
http://www.motionstruct.com
Re: Writing for raspberry from PC?
You can do X11 on RPi as well, but to avail of the hw acceleration you might want to avoid X... Then there is of course Qt and possibly some other portable UI libraries like Gtk...
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Re: Writing for raspberry from PC?
The Pi is (by default) a Linux machine and supports X. I'm not sure why that is a factor. Are you trying to provide a GUI which is portable between Windows and Linux?kamac495 wrote:The only problem is with creating a window I suppose.
On linux it's X11 I guess, while on pi it's something else.
That's the biggest pain.
Re: Writing for raspberry from PC?
I'd actually like to create application non-dependant on X (running fullscreen always). I've got small if not zero experience with coding for Linux, so I am not sure whether I can code such application on Ubuntu (my alt-OS).
My site
http://www.motionstruct.com
http://www.motionstruct.com
Re: Writing for raspberry from PC?
Alternatively you can do compiles on the PC (very fast) and run then result on the Raspi. That's what I do - I run Eclipse on an Ubuntu PC, cross compile using the tools on github, then debug/run on the Raspi itself (I also have the debugger running on the PC debugging remotely to the Raspi).kamac495 wrote:I'd actually like to create application non-dependant on X (running fullscreen always). I've got small if not zero experience with coding for Linux, so I am not sure whether I can code such application on Ubuntu (my alt-OS).
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: Writing for raspberry from PC?
It's still a bit unclear whether you want to:kamac495 wrote:I'd actually like to create application non-dependant on X (running fullscreen always). I've got small if not zero experience with coding for Linux, so I am not sure whether I can code such application on Ubuntu (my alt-OS).
A) run the same application on both RPi and your 'Ubuntu PC', which would require a cross-platform library (Gtk, Qt, ... I wonder if EGL is available on Ubuntu, and if you don't need hw acceleration there is always the framebuffer that is common in both envs...) and most likely cross-compilation for RPi
or
B) code on Ubuntu and run on Rpi, which would be the job for the cross-compiling option jamesh mentioned - using only RPi specific libraries
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Re: Writing for raspberry from PC?
According to what has been said, this:
Seems as to be the best option for me.B) code on Ubuntu and run on Rpi, which would be the job for the cross-compiling option jamesh mentioned - using only RPi specific libraries
My site
http://www.motionstruct.com
http://www.motionstruct.com
Re: Writing for raspberry from PC?
I suppose it is this then: "GNU C/C++ Cross Compiler + Eclipse Development Environment" http://www.raspberrypi.org/phpBB3/viewt ... 33&t=18721
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Re: Writing for raspberry from PC?
I've got small problems with that tutorial, namely I am using Ubuntu and can't install ia32-libs (since as I read, they're deprecated).
I did:
sudo dpkg --add-architecture i386
sudo apt-get update
But yet when I try to run this: arm-linux-gnueabihf-gcc -v
It tells me that file has not been found. (I checked, path is proper and the file is there)
Any tips? Help?
I did:
sudo dpkg --add-architecture i386
sudo apt-get update
But yet when I try to run this: arm-linux-gnueabihf-gcc -v
It tells me that file has not been found. (I checked, path is proper and the file is there)
Any tips? Help?
My site
http://www.motionstruct.com
http://www.motionstruct.com
Re: Writing for raspberry from PC?
Sorry, cannot help you there. Maybe post your problem into the cross-compiling thread? Might get more experienced views...
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
-
- Posts: 24
- Joined: Thu Dec 20, 2012 10:04 am
- Location: Brasil
Re: Writing for raspberry from PC?
Try to use PI emulator in your PC.
I think you can compile C in the Pi emulator window, with some limitations.
http://xecdesign.com/qemu-emulating-ras ... -easy-way/
Gustavo Murta
I think you can compile C in the Pi emulator window, with some limitations.
http://xecdesign.com/qemu-emulating-ras ... -easy-way/
Gustavo Murta
Re: Writing for raspberry from PC?
If using a Linux box (e.g. Ubuntu) grab the Raspberry Pi tool chain (compilers etc) and userland code from here...kamac495 wrote:I've got small problems with that tutorial, namely I am using Ubuntu and can't install ia32-libs (since as I read, they're deprecated).
I did:
sudo dpkg --add-architecture i386
sudo apt-get update
But yet when I try to run this: arm-linux-gnueabihf-gcc -v
It tells me that file has not been found. (I checked, path is proper and the file is there)
Any tips? Help?
https://github.com/raspberrypi
Set up the Eclipse cross compile env to point to the tools (use Linaro tools from the three sets provided - they produce slightly faster code).
In cross settings (project properties, you need to set it up as a cross compile project),
Prefix: arm-linux-gnuabihf-
Path : <whatever you path to tools is>/arm-bcm2708/gcc-linaro-arm-linux-gnuabihf-raspbian
Set up include, libraries etc to point to their location in userland (you will need to run buildme at root of userland to build the libaries)
e,g, One include path might be...
arm-bcm2708/gcc-linaro-arm-linux-gnuabihf-raspbian/arm-linux-gnuabihf/libc/usr/include
There will be more requried (esp. if you need stuff from userland)
That should mostly cover it. I'm going to try and find time to write this stuff up in more detail.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.