树莓派交叉编译 [英] Cross compiling for Raspberry PI

查看:33
本文介绍了树莓派交叉编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Raspberry PI 开发板编写一个 GUI 应用程序,它使用 OpenCV 库来处理一些图像数据.最终结果是一个带有一些按钮和一个显示图像的区域的图形应用程序.

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.

我尽可能避免使用 IDE,因为除了通常与我从事的项目相关的新语言之外,必须为每个工具学习新的 IDE 会变得乏味.我 95% 的开发都是在 VIM 中进行的.

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.

如何设置一个基本的 makefile 项目,该项目利用 GCC、OpenCV、GTK+ 并为在 x86 系统上运行的 Ubuntu 安装上运行的 Raspberry PI(即:arm11)进行编译?目标是使其成为可在任何 Linux 系统上构建的可移植项目.

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.

我熟悉通过 apt-get 安装 OpenCV 和 GTK+ 库,而且我也知道我需要在我的 main.c 文件中包含特定的头文件.现在我只需要找出 makefile 中为 ARM 编译所需的基本语句并链接到适当的库.我通过 apt-get 获得的 OpenCV 库似乎适用于 x86,我不知道是否包含 ARM 变体.

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.

谢谢.

推荐答案

可能需要复习一下你的 Google-fu.

Probably need to brush up on your Google-fu.

这是一个将 GTK+ 构建为交叉编译的 makefile 项目的示例,涵盖了大约 90% 的相关工作.

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/

对于 OpenCV,只需使用上面的说明创建您的 GTK+ 项目,然后只需在 makefile 本身中更新您的 LDFLAGS,并包括在下面的示例中提到的 OpenCV 相关标头.

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/

这篇关于树莓派交叉编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆