Page 1 of 1

Cross Compile and remote debug

Posted: Mon Apr 16, 2018 9:58 pm
by loose_cannon
I see a lot of discussion about building C++ programs on the PI and found some older discussion about building a compiler and then using it on windows to cross compile. I have limited Linux experience and am looking for a complete solution where I do not have to initially build my tools on Windows; and would like to have an IDE in Windows requiring limited configuration to be able to build, deploy, and remotely debug C++ programs on a Pi board with the stock OS. If really required, I could put Ubuntu on a VM. What would be some working solutions that are not overly expensive? If this question has been recently answered and I missed it, a link to some solutions would be helpful. Thank you for any assistance.

Re: Cross Compile and remote debug

Posted: Fri Apr 20, 2018 2:30 pm
by ProgrammingPescador
Hi

I use Visual Studio 2017 with the C++ for Linux Workload, described here. This allows you to do all of your development on Windows, in the Visual Studio IDE, and then compile and debug directly on the Pi, again in the IDE. I have not looked back since!

It is very straightforward to setup and you do not have to mess around with make files if you don't want to

Hope this helps

Re: Cross Compile and remote debug

Posted: Thu Apr 26, 2018 12:27 pm
by paulslocum
I was originally going to set up a cross-compiling environment, but I found it unnecessary and just build my projects with Make on the Raspberry Pi. It builds about as fast as XCode. I edit files directly on the RPi using a PC text editor that supports SFTP and projects, so it feels almost like an IDE.

Re: Cross Compile and remote debug

Posted: Thu Apr 26, 2018 12:34 pm
by PiGraham
Development on the target is definitely viable.
I use VisualGDB for one Pi project. It's a plugin for Visual Studio and gives you the usual intellisense and debug environment. It configures a cross platform build toolchain. Fairly easy and effective.

Re: Cross Compile and remote debug

Posted: Fri Apr 27, 2018 10:35 pm
by loose_cannon
Thank you for your responses.

C++ for Linux working with VS 2017 seams to work well and has an example Pi project. It does a remote build but can be debugged and edited from windows. Very nice for free. VisualGDB seems to be more capable software. There are many options for local and remote building and debugging; and it is fairly inexpensive with a free 30 trial. It was easy enough to get a QT window created on the on the host windows machine using Xming for the remote terminal, or to change the debugger to spawn the window on the display 0. I will probably end up getting a VisualGDB but depends on graphics package support.

Any advice on what setup would work best for a touch screen graphics program on a secondary LCD and FB not running Xterm? It seams the built in QT supports on VisualGDB is for Xterm. GTK or SDL may be better, a newbie like me does still has so much reading to do.

Re: Cross Compile and remote debug

Posted: Sat Apr 28, 2018 12:11 pm
by PiGraham
loose_cannon wrote:
Fri Apr 27, 2018 10:35 pm

Any advice on what setup would work best for a touch screen graphics program on a secondary LCD and FB not running Xterm? It seams the built in QT supports on VisualGDB is for Xterm. GTK or SDL may be better, a newbie like me does still has so much reading to do.
I developed an SDL2 application with VisualGDB and had some problems with debugging with the SDL2 calls. That was a few years ago and may not apply now. I could debug the program logic with SDL calls commented out and I could debug on the target with gdb or other techniques so it wasn't too much of a problem.
If you will particularly focus on graphics check if that works for you in the trial period.