Cloud
Cloud

Reputation: 19333

Cross compiling for Raspberry PI

I am writing a GUI application for the Raspberry PI dev board that makes use of the OpenCV library to process some image data. The end result is a graphical application with some buttons, and an area to display images.

I avoid IDE's when I can, as it gets tedious having to learn a new IDE for every tool, in addition to a new language that usually goes in hand with the projects I work on. 95% of all my development is in VIM.

How do I set up a basic makefile project that makes use of GCC, OpenCV, GTK+, and compiles for the Raspberry PI (ie: arm11) that runs on my Ubuntu installation running on an x86 system? The goal is to make this a portable project that can be built on any Linux system.

I'm familiar with installing the OpenCV and GTK+ libraries via apt-get, and I also know I need to include specific header files in my main.c file. Now I just need to figure out the basic statements needed in the makefile to compile for ARM and link against the appropriate libraries. The OpenCV libraries I get via apt-get seem to be for x86, and I don't know if the ARM variants are included.

Thank you.

Upvotes: 1

Views: 3903

Answers (1)

Ill Tempered Sea Bass
Ill Tempered Sea Bass

Reputation: 309

Probably need to brush up on your Google-fu.

Here is a worked-out example of getting GTK+ building as a cross-compiled makefile project, and covers about 90% of the work involved.

http://hertaville.com/2013/07/19/cross-compiling-gtk-applications-for-the-raspberry-pi/

As for OpenCV, just create your GTK+ project using the instruction above, then just update your LDFLAGS in the makefile itself, and include the OpenCV-related headers noted in this example below.

http://aplacetogeek.wordpress.com/qt-opencv-v4l-cross-compiling-raspberry-pi-beagle-bone/

Upvotes: 1

Related Questions