Programming C/C++ on the RPi is about like doing it anywhere else, your just using an ARM compiler. The GNU compiler tools and gdb debugger are standard on most linux installs and work very well.srjacob wrote: I am a newbe to the PI, but I know C/C++ fairly well. Can anyone point me to a good starting point for programming C/C++ on the PI? Preferrably a good IDE with breakpoints and debugging tools would be wonderful.
Code: Select all
sudo apt-get install build-essential sudo apt-get install g++-arm-linux-gnueabihf sudo apt-get install gdb-multiarch
Call me pedantic but the link you gave does not describe "cross compiling". I is about editing code on the Windows PC and then building and debugging it on a remote Linux machine (Or perhaps the Linux Subsystem for Windows).I would recommend Visual Studio 2017 as it now has the ability to cross compile directly on the Pi, see here.
Yes, typing "make" on a command line is such a chore. Of course after you have done it once it becomes up-arrow, return, which is pretty easy I think.I do all of my C/C++ development this way as it gives you access to all the modern tools and techniques which developers have become used to and saves time and grief with having to wrestle with the command line.
Visual Studio cannot beat the awesome power of nano. Of course for bigger projects I have to break out the big gun, vim.I know it probably goes against the grain to recommend Microsoft tools when there are "powerful tools" like Nano available on the device,
Close. What they perhaps did get right is Visual Studio Code. What with it being Open Source and cross-platform....but for once this is where MS have actually done something right!
From what I can tell a single giant program that includes an editor, compiler and debugger was first popularized in the 80's with Turbo Pascal. The main reason for the integration was because the disk drives were too slow to repeatedly load the editor, compiler and debugger as separate tools and the DOS operating system didn't do disk caching. A generation of programmers who learned to program using Turbo Pascal went on to create exaggerated examples such as Java with Eclipse. At the same time Microsoft saw the vendor lock-in that happened and leveraged that for different purposes.
Yes. Great link!ejolson wrote: ↑Wed Jul 04, 2018 5:09 pmUnix was originally conceived as a programming environment in a different tradition. From the beginning Unix included concurrency and disk caching along with a suitable collection of tools designed for C development tied together by a programmable shell. That's why many consider GNU Linux to already be a development environment such that no all-in-one editor, compiler and debugger is needed.
Naahh ...: vim. vim-full works for me. I've never ventured anywhere near emacs (will have to try one day).emacs...? naaahh...: Geany.