Cross compiling for Raspberry PI

泄露秘密 提交于 2019-12-23 04:38:10

问题


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.


回答1:


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/



来源:https://stackoverflow.com/questions/21713267/cross-compiling-for-raspberry-pi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!