2

I am Windows developer accustomed to Visual Studio Community. Now I'm starting to develop for Linux on both embedded devices (Raspberry Pi, C.H.I.P) and PCs.

I have found that Visual Studio has two options to develop for Linux:

  • VisualGDB - Visual Studio extension for cross-compiling and remote debugging, but it costs too much for my current budget

  • the brand new Microsoft extensions: Visual C++ for IoT Development and Visual C++ for Linux Development, but they are buggy, they copy every file on every build and they are difficult to configure "Linux way" (no full make/cmake support, must use absolute include paths on remote machine) and also Intellisense does not work reliably.

So I'm ready try something less restricted than Visual Studio but with somewhat similar quality and workflow, and my current best option seems to be QtCreator.

How do I achieve building for Linux from QtCreator running on Windows machine

Which approach is supported or works better (provides auto-complete and debugging conveniences) with QtCreator - cross-compile & copy binaries and launch GDB, or building the project remotely (but with option to not copy files, in case I'm building on a Samba shared folder)?

JustAMartin
  • 13,165
  • 18
  • 99
  • 183
  • I've used Qt creator was a nice experience. Did x86 Linux to armv7 Linux. However, getting the actual toolchain was pretty easy. Do you have a cross toolchain available for Windows to crosscompile for Arm? It is not related to an IDE. – TheMeaningfulEngineer Jun 16 '16 at 10:16
  • 1
    Maybe [this post could help](http://stackoverflow.com/questions/11420984/qtcreator-on-windows-to-cross-compile-for-linux-arm-with-codesourcery-toolchain). BTW as far as you have a SDK, toolchain and cross compiler, you can configure a QTCreator kit to do what you need. – LPs Jun 16 '16 at 10:19
  • @Alan - I guess, toolchain should not be a problem - there are lots of options out there, but I'm not sure if I should cross-compile or remote-compile because I have no idea which option would work better with QtCreator, considering autocomplete, error highlighting, debugging in IDE. – JustAMartin Jun 16 '16 at 10:27

1 Answers1

1

Which approach is supported or works better (provides auto-complete and debugging conveniences) with QtCreator

Given that you say the cross toolchain is not a problem, my biggest parameter for the choice would be the size of the project and compile time. If it's a project that you can cross build in few minutes I would go for the local option.

A few notes on the prerequisite when cross compiling: You should have a sysroot of the device your cross-compiling to which from which the linker will get all the appropriate libraries that aren't dynamically linked.

When remote debugging, I found the following a best practice. You have to have two debugging apps, gdb and gdbserver. Gdbserver is run on the embedded device while you're running gdb on the host machine. To be able to step through the code at runtime, you need to cross compile with debugging symbols. If the device has sufficient memory, you can deploy the whole binary with debugging symbols on the device.

This is a big topic :) I suggest you ask subquestions so we can form the answer step by step.

TheMeaningfulEngineer
  • 15,679
  • 27
  • 85
  • 143