These are the steps that I used to set up cross compiling (It also has getting Eclipse and QT for the sake of completeness. Also I have wholesale copied instructions from various websites that showed how to do some of the individual bits. I apologize for not properly attributing these, but I originally wrote this list for my own memory and have since forgotten where I borrowed from.):
- Load Eclipse using the Applications->Ubuntu Software Center application.
- In the search box type eclipse
- Select the Eclipse IDE item from the list
- Press the “Install” button
- Open Eclipse (by typing eclipse at the command line)
- Ensure the C/C++ development tools are part of Eclipse
i. Select the “Help->About Eclipse SDK” menu option
ii. The About dialog displays icons representing all plugins which are part of Eclipse.
- If “Eclipse CDT” is not one of the icons, install it
i. Select the “Help->Install New Software…” menu option
ii. Select “Work with: All Available Sites” from the site list near the top of the dialog
iii. Select “Programming Tools->Eclipse C/C++ Development Tools” from the software list.
iv. Follow the dialog steps to install the tools.
- Load QT using the Applications->Ubuntu Software Center application
- Select the “Developer Tools” item from the Departments list
- In the search box type QT
- Select the QT 4 Designer item and press the “Install” button.
- Optionally, select the QT 4 Assistant item and press the “Install” button1. Download the QT Eclipse Integration for C++ package from http://qt.nokia.com/developer/eclipse-integration/
- Use the Linux x86 32bit version.
- Find the eclipse/plugins directory, likely /usr/lib/eclipse/plugins
- Change to the base directory, e.g. /usr/lib and extract the package:
i. cd /usr/lib
ii. sudo tar xzf ~/Downloads/qt-eclipse-integration-linux-x86-<version>.tar.gz
- Start a clean configuration of Eclipse:
i. eclipse –clean
ii. Exit eclipse
- Extract the cross-compiler
- Get one of the pre-made toolchains from Angstrom (http://www.angstrom-distribution.org/toolchains/) or build your own toolchain.
- Extract the cross-compiler
i. cd /
ii. sudo tar –xjvf pathname/to/your/Angstrom/toolchain/tarball
- Set up a cross-compiled “Hello World” program:
- Run eclipse
- Create a “New C Project”
i. File->New->C Project
- Call the project “HelloBeagle”
- Select “Hello World ANSI C Project”
- Select “Finish”
- Right-click on the “HelloBeagle” project folder and create a new Build Configuration:
i. Build Configurations->Manage…
ii. Select “New”
iii. Set the Name: to BeagleBoardRelease
iv. Set the Existing configuration to “Release”
v. Press “OK” and “OK” to leave the dialog
- Right-click on the “HelloBeagle” project folder and set the properties of the cross-compiled target:
i. Select Properties
ii. Select C/C++ Build->Settings
iii. Reset the GCC C Compiler “Command:” to
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc
iv. Add the following include path to the “Directories”
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include
v. Reset the GCC C Linker “Command:” to
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc
vi. Add the following library path to the “Libraries”
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/lib
vii. Reset the GCC Assembler “Command:” to
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-as
- Set the active target to BeagleBoardRelease
i. Right-click on the “HelloBeagle” project folder
ii. Select “Build Configurations->Set Active->BeagleBoardRelease”
- Right-click on the “HelloBeagle” project and select “Build Project”
- If you copy the resulting executable to a Beagleboard running Angstrom, the executable will perform as expected. (at least on my machine.)
I hope this helps.
Derek