1

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...

2 Answers 2

1

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.

1
  • 2
    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. Commented Nov 29, 2012 at 21:39
3

You can setup a cross compiler for Rasberry Pi in Ubuntu by following the steps in https://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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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