Cross compiler for OF 0.9.0/Jessie/arm6/RPi1


Even if sudo works - this issue is likely to be in the


In these instructions you should be the pi user, not root


Hi @jvcleave

Thanks for your useful tutorial.
I followed your tutorial, and I got same error as @moebiussurfing

But I succeeded to compile!!!

In, I added this line below setting variables.


I think USE_NEWLIB should be set to 0 or 1 in the script.

Cross compiling OF app for Raspberry Pi

Thanks! I did actually have that in there but the link to the raw version remained pointing to an older version.


Hi, Thanks for your answer. Back again on this project.

when executing sudo ls -al /media/Data

I get this:

drwxr-xr-x 21 root root    0 Jan 25 17:35 .
drwxr-xr-x  4 root root 4096 Jan 25 20:07 ..
drwxr-xr-x  2 root root    0 Jan 25 18:28 bin
drwxr-xr-x  5 root root    0 May 28  60056 boot
drwxr-xr-x 15 root root    0 Jan 25 19:42 dev
drwxr-xr-x 80 root root    0 Jan 25 19:57 etc
drwxr-xr-x  3 root root    0 Nov 21 21:32 home
drwxr-xr-x 17 root root    0 Jan 25 18:14 lib
drwx------  2 root root    0 Nov 21 20:35 lost+found
drwxr-xr-x  2 root root    0 Nov 21 19:50 media
drwxr-xr-x  2 root root    0 Nov 21 19:50 mnt
drwxr-xr-x  3 root root    0 Nov 21 21:32 opt
dr-xr-xr-x 92 root root    0 Jan  1  1970 proc
drwx------  2 root root    0 Nov 21 19:50 root
drwxr-xr-x 18 root root    0 Jan 25 19:57 run
drwxr-xr-x  2 root root    0 Jan 25 18:41 sbin
drwxr-xr-x  2 root root    0 Nov 21 19:50 srv
dr-xr-xr-x 11 root root    0 Jan  1  1970 sys
drwxrwxrwt  7 root root    0 Jan 25 20:04 tmp
drwxr-xr-x 10 root root    0 Nov 21 19:50 usr
drwxr-xr-x 11 root root    0 Nov 21 22:32 var

I’ve literally reinstalled everything, but the same problem occurs.

Other stuff I’ve tried:

pi@debian:~/RPI_ROOT$ sudo ls -al /media/Data/home/pi 
ls: cannot access /media/Data/home/pi: Permission denied
pi@debian:~/RPI_ROOT$ sudo ls -al /media/Data/home/pi 
ls: cannot access /media/Data/home/pi: Permission denied
pi@debian:~/RPI_ROOT$ sudo ls -al /media/Data/home/pi/openFrameworks
ls: cannot access /media/Data/home/pi/openFrameworks: Permission denied
pi@debian:~/RPI_ROOT$ cp -Rv /media/Data/usr/ usr
cp: cannot stat ‘/media/Data/usr/’: Permission denied


I found out that it could be the version of Samba i’m using. I’m currently downgrading to v3 samba using this manual:


Thanks for your guide @jvcleave :slight_smile:

I’m having the same permissions problem on a fresh Jessie install on an rpi1 B. I can mount Data and see all the folders, but can not navigate further due to that permissions issue.

I found out that just changing the [Data] path from / to /etc/ works correctly but were not able to find a solution. So it seems that Samba can not set permissions on the root dir (/).

@ikillbombs2 Let us know if downgrading Samba helped :slight_smile:

Edit: Got somewhat further by creating a ‘symlink mount point’:

  • sudo -i
  • mkdir /rootfs && mount --bind / /rootfs
  • Then set path to /rootfs instead of /
1 Like

Here are the package versions I have (just straight from Raspbian):

samba 2:4.1.17+dfsg-2 
cifs-utils 2:6.4-1      

I’m using: (command used: apt-cache policy samba)
I guess the +deb8u1 part doesn’t change much …

Samba: 2:4.1.17+dfsg-2+deb8u1 
Cifs-utils: 2:6.4-1

So the trick I posted previously fixed the Samba issue for me. :slight_smile:
Note that you have to rebind the mountpoint each time you rebooted the rpi. ( mount --bind / /rootfs )

Some more feedback:

  • In earlier steps of this guide, I figured out that I had to create a new NAT interface (in VB’s global settings) in order to be able to communicate between Ubuntu (guest machine) and the rpi (Using VirtualBox for the first time). Alternatively, using a Bridged Adapter also worked for me.

  • Once the pi user account is created on the VM, I didn’t get that you have to log in with that account. ( thus I first created RPI__ROOT in /home/MyUser instead of /home/pi ). I also think that this is related to the errors stated by @moebiussurfing because (which I also got trough).
    The Samba folder (/media/Data) was owned by MyUser instead of pi, throwing permissions errors on compilation time. Chmodding the of the OF root dir to 0777 helped a little but not enough so I guess you have 2 options:

    • Restart the whole guide switching to the pi user at the right time (untested).
    • I removed the MyUser account from the VM, then restarted in recovery mode with root access, mounted the linux partition as +rw ( mount -o remount,rw / ) then I used [l0b0’s solution] ( to change the user & group ID of user pi (1001 in my case) to the previous MyUser id. (to find an user id, type id in the terminal when being logged in with the user)
  • It could also be nice to indicate the required disk size of the VM, concerning the /usr folder to be copied into RPI_ROOT and compiling the cross compiler. You need about 6Gb just for the cross compiler, my partition is now a little over 10Gb in size so a ±15Gb partition would make it. (I had to resize it as I thought 10Gb would be enough)

  • I made a small gist grouping the steps to sync the RPi with your VM.
    They also include reminders for recurrent commands.

Everything works fine now, I can finally cross compile! :smiley:
Thanks again for this guide, I hope my contributions will help.

1 Like

Glad you got it figured out!

I did mention that I had setup the VM with the primary user as “pi” but I added a clarification that you had to log in as that user. I only have pi and root as users on the VM.

It was also stated that the VM size should be at least 10GB but I just added 15GB is recommended if you can spare it

I use the fstab entries but If the RPI isn’t automatically mounted sudo mount -a usually works for me.


Thanks! :slight_smile:

For the note: it also works fine with custom libraries such as libWiringPi and pigpio.


yeah - it’s a full cross-compiler so will work for anything


stuck at the symlink permission stuffs and this fix works for me too. Thanks for sharing!


my root drive isn’t mounting in samba following this guide

if i change path = / to path = /home/rich then it will mount that folder, but using path = / will just create an empty folder named data on my mac.

i’m using pi 2 model b, raspbian, mac os x 0.11


@rjlwest Are you trying to mount the RPi from the Mac Finder or inside the VM?


from inside the finder, command k then smb://raspberry.pi.ip/Data as server address.

does it show up correctly in the vm? I hadn’t got that far.


try just smb://raspberry.pi.ip


Both ways (with or without /Data) work for me


i get that but when i click the data folder, it’s empty


also the rasbian image link is dead, this one works though

I noticed there was a current folder, maybe that would have a permanently supported link in it


I’ve installed the debian image on the virtual machine, when I enter this

sudo apt-get install gawk pkg-config make build-essential cifs-utils avahi-daemon avahi-utils libavahi-compat-libdnssd-dev

I get a pile of errors along the lines of “package gawk is not available, but is referred to by another package” and “package ‘gawk’ has no installation candidate”

it does it for all of them

solved: if anyone gets this, it’s because you installed from disk and didn’t have a mirror set up by default and so your sources file doesn’t point to any online locaiton your packages will be, you need to re generate it from here


quite a stubborn one now

cp: cannot stat ‘/media/Data/usr/‘: Permission denied

and I can’t seem to do anything to that folder. I tried setting permissions but no matter what it’s always saying permission denied.