6

Since I got my RPi, I have been playing with it and I am really happy that I bought it!

I use various programs on it but it takes a long time to build them. So I had an idea. What if I could build my programs on my quad-core PC, it will be a lot faster!? ^^

Is there a way to build my programs on Windows or Debian on my PC for my RPi ?

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105
Tiwenty
  • 213
  • 1
  • 2
  • 5

3 Answers3

2

I just gave an answer to a similar question here:

Can I use my Ubuntu desktop to cross-compile the GO language environment for my Pi?

NB. I'm not Frepa ;)

To summarize, yes it is, but building a cross-compiler is not a trivial task for most people; I recently used crosstool-NG to do it which A) made the procedure pretty painless, B) produced a c/c++ compiler that works to compile executables for the pi.

If you just want this to build your own stuff then I do recommend it if the caveats I mentioned there about use of autotools and pkg-config do not apply or you are willing to deal with the hassles to make that happen (dealing with those hassles may take you longer than just compiling on the pi, so...).

Crosstool-ng can produce a basic environment in which you can compile programs that rely on the standard libraries + POSIX threading (that's what I tested successfully). Beyond that, you have to build any support libraries you use (sqlite, curl, ncurses, etc.) in that environment first too.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
2

This may help you, he explained it very nicely:
Development environment raspberry cross compiler

Edit: Link is currently broken: PDF Mirror

duslabo
  • 191
  • 1
  • 2
  • 8
2

You can build Raspberry Pi cross-compiler running on Windows by using MinGW, Cygwin and some patches from Raspbian repository, here is an instruction how to do it: http://www.gurucoding.com/en/rpi_cross_compiler/index.php