Build firmware for Raspberry Pi 2 on Ubuntu Linux under Qt Creator Or Eclipse

Source data:

  1. Host machine is Ubuntu Linux 16.04 LTS.
  2. Remote board is Raspberry Pi 2 Raspbian.
  3. Toolchain for cross-compilation for Raspberry Pi 2.
  4. IDEs are Qt Creator and Eclipse.

My tasks:
0. Create test C++ app with Qt Creator or Eclipse for IDE development and remote debugging using cross toolchain.

  1. Build firmware using Qt Creator or Eclipse and cross toolchain for Raspberry Pi 2.
  2. Setup remote debugging using one of the above-mentioned IDE.

Task 0. I created the test C++ project under Eclipse and managed to build and setup remote debugging using Eclipse Kepler.
So now i can cross-compile and remotely debug C++ projects using Eclipse Kepler.

Task 1. However, when i start with PX4 firmware i encounter with problem while cross-compilation.
1.1. Problem with Eclipse.
When i try to import already existed PX4 project into my workspace Eclipse doesn’t allow me to specify path and prefix to my RPI toolchain. It’s strange because when i create my test project everything is ok. In addition, when i try to import my test project(not create, just import already existed project), then Eclipse again hides the tab which used to specify path and prefix for cross-toolchain (Project Explorer->Properties->C/C++ Build/Settings->Toolchain Editor).
So, is it an issue with Eclipse?
1.2. Problem with Qt Creator.
According to the instructions from i created project file and launched Qt Creator. The PX4 Firmware builds ok, but only for the native host machine.
To make it work with cross-toolchain i changed path for the compiler and kits.
Compilation goes fine (with cross-gcc) but when linker is invoked it shows linkage error.
Of course, it should be, since i changed only compiler path, not linker, etc…
The only way i see now is to change every path for make, gcc, g++, ar, ld, etc manually in project settings from their default values to cross-toolchain paths.
But i think it’s too debug-prone way, is there more direct and clean option?

Thanks in advance!

I fixed problem with Eclipse. After import as “Existing code as makefile project”, in project settings (Properties->C/C++ Build) it needs to check “Generate makefiles automatically”. After that Eclipse allows to setup toolchain prefix and path as it was needed.