Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I want to develop C++ applications for my PI on my PC, I made a develop environment in Ubuntu with the Code::blocks IDE. The problem is that my PC is X86, and the PI is ARM. So how can I add ARM to the build target in Code::Blocks? I switched to a ARM compiler, but he can't find the compiler.

Could not auto-detect installation path of "GNU ARM GCC Compiler"...
Do you want to use this compiler's default installation directory

And:

XXX uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

It seems that you need to set up a complete toolchain to do cross-compiling (which includes a linker and libraries). According to this blogpost you can set up the ARM toolchain with crosstool-ng. After doing that, I would write a makefile or CMakeLists.txt for testing. I don't know Code::blocks but perhaps it can set up Projects based on makefiles or CMakeLists.txt-files.

share|improve this answer
1  
One you have an arm linux toolchain installed and working, you can create a Code::blocks compiler entry for it, probably by copying the host linux one and changing the executable names and directories, ie, gcc becomes arm-linux-whatever-gcc ld becomes arm-linux-whatever-ld and so on. Setting up GDB for gui debugging will be a bit more complicated given the need to work through gdbremote and have a mechanism for deploying to the target. –  Chris Stratton Nov 29 '12 at 21:39
add comment

You can setup a cross compiler for Rasberry Pi in Ubuntu by following the steps in http://stackoverflow.com/questions/19162072/installing-raspberry-pi-cross-compiler

Then you need to create a new entry to use this cross compiler in Code::Blocks.

From the Settings menu, select Compiler.... In the Global compiler settings copy an existing compiler. E.g. select GNU ARM GCC Compiler under Selected compiler then click the Copy button and enter a compiler name.

Configure the Toolchain executables for the cross compiler like the following:

ToolchainExeSettings

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.