在windows环境下,使用Eclipse和gcc-Linaro工具链,对BeagleBone进行交叉编译和远程部署

from: http://beaglebone.globalmultimedia.in/


该文章详细解释了在windows 7中如何设置 gcc交叉编译器的C/C++工具链和Eclipse IDE,并且展示了怎么与BeagleBone板一起使用。

步骤1:设置Eclipse

下载并解压缩适用于你平台(32位或者64位)的Eclipse;Download Eclipse

Eclipse不需要安装;它可以按照你的意愿,放置在任意的驱动器或者文件夹中。

解锁Eclipse应用,单击以启动Eclipse;将工作区设置到“F:/workspace”中,“F"是驱动器名称;可以选择其它任意的驱动器或者文件夹名称;
在Eclipse启动之后,”Help > Installation Details“后面跟随这展开的树视图,显示了支持的GCC C/C++交叉编译器。

步骤2:设置交叉编译器

交叉编译的工具链可以从后面的链接下载https://releases.linaro.org/latest/components/toolchain/binaries/

从提供的选项列表中选择 "gcc-linaro-arm-linux-gnueabihf-X.X-XXXX.XX_win32.zip";

当写这篇文章的时候,它是:https://releases.linaro.org/latest/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_win32.zip 

 Linaro Changes 2014-11 Folder 2015-02 Folder

将该内容解压缩到“F:/gcc-linaro/”,F是选择的驱动器。

从以下链接中下载并提取“make.exe";复制到“F:/gcc-linaro/bin"文件夹中。

 Download make.exe


从链接 http://softlayer-sng.dl.sourceforge.net/project/gnuwin32/make/3.81/make-3.81-dep.zip 中提取“libiconv2.dll"、"libintl3.dll",并复制到相同的文件夹 “F:/gcc-linaro/bin”中。

现在完成了基本的安装工作。


步骤3:建立一个新的C工程

在Project Explorer窗口上右击,并选择New->C Project

  • 输入该工程名称,例如 ‘Brahma’;

  • 选择Hello World ANSI C Project;

  • 勾选复选框,以便于只显示支持的工具链;

  • 单击 Next;

  • 在Author处输入你的名称 - 例如: ‘Aham Brahmasmi’;

  • 单击 Next;

 

单击Advance Settings,显示"Properties for Brahma"。

展开“C/C++ Build",选择“Environment”,单击“PATH”并添加“F:\gcc-linaro\bin;...",不要删除其它值。

  • 展开C/C++ 大纲;

  • 选择“Pre-processor Paths, Macros etc.”;

  • 在Providers页,选择“CDT Cross GCC Built-in Compiler Settings”;

  • You may notice that the project explorer shows the name of the Project with an error mark and the Problems window displays Errors (2 items).

You need not worry about the errors as the settings are yet incomplete. The errors would reset automatically after all the settings are completed.

  • Keep clicking Move up until it reaches the top, as first option

  • Click OK (You may also Click Appy prior to this)

Click Next. Notice that any additional configurations can be added later also.

  • 将cross compiler Prefix设置为“arm-linux-gnueabihf-“;注意,末尾的连接符号 ’-’ 是必需的。

  • Browse and select the bin path where you extracted the linaro Compiler tools and placed GNU make

  • 现在该部分的工作已经完成,所有的错误也都消失了。

步骤4:构建该工程

右击该工程并选择Build Project;

The Project ‘Debug’ Configuration get built producing the binaries.

"Build Configurations > Set Active > Release"

And it's done.

步骤5:在Eclipse上建立远程系统浏览器


选择所有可用的站点,并且等待列表框被填写。

选择“Mobile and Device Development"下面的选项,接受许可协议并安装。

单击Yes按钮并重启Eclipse;

步骤6:连接到远程系统

Allow Access for Eclipse to use the network. After Eclipse Restarts “Window > Show View > Other”

Select Remote System and click ok.

选择Remote System,单击ok。

单击“Define a Remote connection”;

选择“SSH only”并单击Next;

设置该连接并结束;

步骤7:连接

Default IP address “192.168.7.2” of Beglebone Black connected to the Windows System is to be entered in the Editable Combo Box for Host Name.


Expand the Sftp Files Tree and Note "My Home" and "Root"

Expanding My Home brings up Login Window. Default UserID for Beaglebone Black is “root” and leave blank for Password.


步骤8:上载

将“Release”目录下的“Brahma”拖动到“root”(“My Home”)目录下。

步骤9:加载终端
步骤10:检查并执行

在Terminal中输入“dir”,并检查你的可执行文件;在设置完可执行标志后,命令“./Brahma” 将执行该程序。


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是在 Ubuntu 18.04 操作系统下,使用 gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf 交叉编译 Qt 5.6.2 的流程: 1. 下载 gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf 工具,并解压到某个目录下。 2. 安装 Qt 5.6.2 的依赖库: ``` sudo apt-get update sudo apt-get install build-essential perl python git sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxslt1-dev libgl1-mesa-dev libglu1-mesa-dev libsqlite3-dev libmysqlclient-dev libpq-dev libiodbc2-dev libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libxrandr-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev libgstreamer-plugins-ugly1.0-dev gstreamer1.0-libav gstreamer1.0-alsa gstreamer1.0-pulseaudio libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev libgstreamer-plugins-ugly1.0-dev ``` 3. 下载 Qt 5.6.2 的源代码,并解压到某个目录下。 4. 进入 Qt 5.6.2 的源代码目录,执行以下命令: ``` ./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=/path/to/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /path/to/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5arm -no-xcb -no-pch -no-icu -no-gif -no-libjpeg -no-libpng -no-harfbuzz -no-openssl -no-qml-debug -nomake examples -nomake tests ``` 其中,/path/to/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf 是 gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf 工具的路径,/path/to/sysroot 是交叉编译环境的根文件系统路径。 5. 执行 make 命令进行编译: ``` make -j4 ``` 其中,-j4 表示使用 4 个线程进行编译。 6. 执行 make install 命令进行安装: ``` sudo make install ``` 7. 完成后,在 /usr/local/qt5arm 目录下会生成 Qt 5.6.2 的安装文件。把该目录添加到交叉编译环境的 PATH 环境变量中即可使用

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值