iuliean
Posts: 5
Joined: Thu Jul 22, 2021 11:03 am

C++ development for the Raspberry

Thu Jul 22, 2021 11:07 am

What tools does one need to develop for Raspberry

I want to make a little thermostat for a raspberry pi zero W A and idk what tools i need or how to make visual studio compile for linux arm

User avatar
Paeryn
Posts: 3349
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: C++ development for the Raspberry

Thu Jul 22, 2021 3:35 pm

iuliean wrote:
Thu Jul 22, 2021 11:07 am
What tools does one need to develop for Raspberry

I want to make a little thermostat for a raspberry pi zero W A and idk what tools i need or how to make visual studio compile for linux arm
RaspberryPiOS comes with the usual Linux programming tools, GCC is the included compiler which provides g++ for compiling C++ code (though you can always install clang too if you prefer it).

Their are plenty of free editors / IDEs available: Vim, Emacs, Nano, Code::Blocks, VSCode etc., if your favourite one isn't already installed then there's a good chance it's available in the repos just waiting to be installed.

Basically everything you need to start programming for the RPi is already installed in RPiOS (other distros may differ, especially a bare-bones distro).
She who travels light — forgot something.
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!

iuliean
Posts: 5
Joined: Thu Jul 22, 2021 11:03 am

Re: C++ development for the Raspberry

Tue Jul 27, 2021 12:53 am

Paeryn wrote:
Thu Jul 22, 2021 3:35 pm
iuliean wrote:
Thu Jul 22, 2021 11:07 am
What tools does one need to develop for Raspberry

I want to make a little thermostat for a raspberry pi zero W A and idk what tools i need or how to make visual studio compile for linux arm
RaspberryPiOS comes with the usual Linux programming tools, GCC is the included compiler which provides g++ for compiling C++ code (though you can always install clang too if you prefer it).

Their are plenty of free editors / IDEs available: Vim, Emacs, Nano, Code::Blocks, VSCode etc., if your favourite one isn't already installed then there's a good chance it's available in the repos just waiting to be installed.

Basically everything you need to start programming for the RPi is already installed in RPiOS (other distros may differ, especially a bare-bones distro).
sorry took me too long to respond, but the rpi is very slow at compiling since the framework i am using (crow) also uses the boost library and that takes ages to compile on it, that's why i want something i can use on a windows/linux machine i guess i asked the wrong question the first time

User avatar
HermannSW
Posts: 4544
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: C++ development for the Raspberry

Tue Jul 27, 2021 6:49 am

Pi0 is a single core CPU, not really suited for compilation of big projects.
What you want is cross compilataion, that is possible.
But compilation on quad core Pi4B (or better Pi400 that is faster with default values) will speed up greatly. Using USB storage instead of micro SD card will speed up even more.
https://stamm-wilbrandt.de/2wheel_balancing_robot
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/raspiraw
https://stamm-wilbrandt.de/en/Raspberry_camera.html

iuliean
Posts: 5
Joined: Thu Jul 22, 2021 11:03 am

Re: C++ development for the Raspberry

Tue Jul 27, 2021 7:10 am

well can you help a brother out with a guide or something because i've been searching a lot the past few day with little success

dsyleixa123
Posts: 1535
Joined: Mon Jun 11, 2018 11:22 am

Re: C++ development for the Raspberry

Tue Jul 27, 2021 8:24 am

edi,
sorry, I overread this
sorry took me too long to respond, but the rpi is very slow at compiling since the framework i am using (crow) also uses the boost library and that takes ages to compile on it, that's why i want something i can use on a windows/linux machine i guess i asked the wrong question the first time
Last edited by dsyleixa123 on Thu Jul 29, 2021 4:21 pm, edited 1 time in total.

swampdog
Posts: 764
Joined: Fri Dec 04, 2015 11:22 am

Re: C++ development for the Raspberry

Thu Jul 29, 2021 12:50 pm

Ubuntu has a lot of cross tools. I took at peek at crow and tbh I'm not much wiser except to note I suspect you'll have to cross-compile an awful lot of stuff unless ubuntu magically has the lot.

I'd tentatively suggest doing this natively. Use an rpi4 for development.

I mention the following because boost is a compiler killer. Does it still use bjam btw? A common workaround, back in the days when processors worked in MHz, was an intermediate static lib and lots of source files, as opposed to less source files which pull in every header under the sun.

It's also possible to fudge 'distcc' so that it calls a cross-compiler thinking it is native, eg: DISTCC_HOSTS="foo bar localhost/3" where "foo" and "bar" are fast boxes and "localhost/3" is an rpi4 (leave one core for linking) upon which you initiate the build. Advantage of this method is "foo" and "bar" only require a working arm-cross (not even linker) and no arm libs required on "foo" or "bar".

User avatar
jahboater
Posts: 7331
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: C++ development for the Raspberry

Thu Jul 29, 2021 6:02 pm

swampdog wrote:
Thu Jul 29, 2021 12:50 pm
I'd tentatively suggest doing this natively. Use an rpi4 for development.
+1
I use an 8GB Pi4 running at 2100MHz for most development now and find compilation times pleasingly quick.
Use "make -j 4" to utilize all four cores if your project has multiple source files.

Developing on a fast Pi is also very likely the simplest solution.

iuliean
Posts: 5
Joined: Thu Jul 22, 2021 11:03 am

Re: C++ development for the Raspberry

Thu Jul 29, 2021 9:22 pm

swampdog wrote:
Thu Jul 29, 2021 12:50 pm
Ubuntu has a lot of cross tools. I took at peek at crow and tbh I'm not much wiser except to note I suspect you'll have to cross-compile an awful lot of stuff unless ubuntu magically has the lot.

I'd tentatively suggest doing this natively. Use an rpi4 for development.

I mention the following because boost is a compiler killer. Does it still use bjam btw? A common workaround, back in the days when processors worked in MHz, was an intermediate static lib and lots of source files, as opposed to less source files which pull in every header under the sun.

It's also possible to fudge 'distcc' so that it calls a cross-compiler thinking it is native, eg: DISTCC_HOSTS="foo bar localhost/3" where "foo" and "bar" are fast boxes and "localhost/3" is an rpi4 (leave one core for linking) upon which you initiate the build. Advantage of this method is "foo" and "bar" only require a working arm-cross (not even linker) and no arm libs required on "foo" or "bar".
i can't use an rpi4 i have a pi zero W. i have it because this is my first pi project and it was the cheapest and even with the code in python with django it seemed to handle things ok ish that's why i am switching to c++ that and i want to learn more about the language.

as for what you said regarding compiling until i had to deal with GPIO stuff it was ok because i could compile it on my linux machine and if it worked it would work on the pi as well, but since i need wiringPi to handle that stuff i have to compile it on the pi everytime to see if it works.

i also tried precompiling the crow headder since that requires boost and it's the biggest time consumer but you can't do that because when you compile it you have to have a #define CROW_MAIN somewhere in your code and since i am trying to compile the headder itself i dk if it is a good idea to make it a compiler define

after searching for a while i found a arm compiler on the arch AUR i tried to compile stuff with it and i got some messages that some libs were missing and i started digging through pi's files and found the c++ libs and i pulled some of those to my pc and things started to work but then it asked for some files that were not on the pi and then i gave up after trying to find those file online for a bit.

also i don't know what fudging and distcc are sorry :)

swampdog
Posts: 764
Joined: Fri Dec 04, 2015 11:22 am

Re: C++ development for the Raspberry

Thu Jul 29, 2021 10:27 pm

jahboater wrote:
Thu Jul 29, 2021 6:02 pm
swampdog wrote:
Thu Jul 29, 2021 12:50 pm
I'd tentatively suggest doing this natively. Use an rpi4 for development.
+1
I use an 8GB Pi4 running at 2100MHz for most development now and find compilation times pleasingly quick.
Use "make -j 4" to utilize all four cores if your project has multiple source files.

Developing on a fast Pi is also very likely the simplest solution.
I suspect using a full 'clang' will also help. Its linker uses far less memory. I have no stats for this statement except for when I was bootstrapping clang on my PC and spotted the gcc linker using 7.9Gb. I had to use "-DLLVM_PARALLEL_LINK_JOBS=1" to fudge it through.

For giggles, I ran the same script on an rpi64 (it's a QT build +stuff). It resulted in a qtcreator (albeit without vulkan) after the weekend. Amazingly, it did it without the extra swap I normally add manually.

swampdog
Posts: 764
Joined: Fri Dec 04, 2015 11:22 am

Re: C++ development for the Raspberry

Fri Jul 30, 2021 12:56 am

iuliean wrote:
Thu Jul 29, 2021 9:22 pm
swampdog wrote:
Thu Jul 29, 2021 12:50 pm
Ubuntu has a lot of cross tools. I took at peek at crow and tbh I'm not much wiser except to note I suspect you'll have to cross-compile an awful lot of stuff unless ubuntu magically has the lot.

I'd tentatively suggest doing this natively. Use an rpi4 for development.

I mention the following because boost is a compiler killer. Does it still use bjam btw? A common workaround, back in the days when processors worked in MHz, was an intermediate static lib and lots of source files, as opposed to less source files which pull in every header under the sun.

It's also possible to fudge 'distcc' so that it calls a cross-compiler thinking it is native, eg: DISTCC_HOSTS="foo bar localhost/3" where "foo" and "bar" are fast boxes and "localhost/3" is an rpi4 (leave one core for linking) upon which you initiate the build. Advantage of this method is "foo" and "bar" only require a working arm-cross (not even linker) and no arm libs required on "foo" or "bar".
i can't use an rpi4 i have a pi zero W. i have it because this is my first pi project and it was the cheapest and even with the code in python with django it seemed to handle things ok ish that's why i am switching to c++ that and i want to learn more about the language.

as for what you said regarding compiling until i had to deal with GPIO stuff it was ok because i could compile it on my linux machine and if it worked it would work on the pi as well, but since i need wiringPi to handle that stuff i have to compile it on the pi everytime to see if it works.

i also tried precompiling the crow headder since that requires boost and it's the biggest time consumer but you can't do that because when you compile it you have to have a #define CROW_MAIN somewhere in your code and since i am trying to compile the headder itself i dk if it is a good idea to make it a compiler define

after searching for a while i found a arm compiler on the arch AUR i tried to compile stuff with it and i got some messages that some libs were missing and i started digging through pi's files and found the c++ libs and i pulled some of those to my pc and things started to work but then it asked for some files that were not on the pi and then i gave up after trying to find those file online for a bit.

also i don't know what fudging and distcc are sorry :)
fudge=hack (but more politely ;-))

'distcc' is a way of getting other machines to compile stuff. Imagine you have two linux boxes, "foo" and "bar". You're using "foo" which has 6 cores and "bar" has 8 cores. You start a compilation on foo (make -j6) but wouldn't it be nice if you could say (make -j14) and get "bar" to compile stuff as well. That's what 'distcc' does. By default 'distcc' will only invoke the same compiler on both boxes. However, if you hack some settings, it's possible to fool 'distcc' into invoking a cross compiler.

I suggest you give up trying crow on rpiZ. Use plain C or better, python, because it stands the best chance of supporting your temperature sensor.


I did say "unless ubuntu magically has the lot". It is *really* hard to cross-compile. It is even harder to keep a cross compilation environment up to date. For every hour you spend trying to get cross-compilation to work, drop a £1 into a jar. You'll be able to buy an rpi4 sooner.

Here's my script to build an arm-cross under linux mint..

Code: Select all

#!/bin/bash

NAM=`basename "$0"`
CWD=`pwd`
SUB="/usr/local/sd/syschk/lib"

. "$SUB""/f_go"

: ${BU_PKG:="binutils"}
: ${BU_VER:="2.31.1"}

: ${LK_PKG:="linux"}
: ${LK_VER:="4.19.66"}

: ${GC_PKG:="gcc"}
: ${GC_VER:="11.1.0"}

: ${LC_PKG:="glibc"}
: ${LC_VER:="2.33"}

#TGT_NAM=
PFX=
CFG=

REQ="$CWD/gc/REQ"
: ${NPROC:="-j"`f_go_bproc`}
D_RPI="/usr/local/RPI"

fcp_chk_make ()
{
 [ -z "$MAKE" ] && MAKE=`which make`

 local	n=`f_go_os`
 local	v=`f_go_os_ver`
 local	m=`$MAKE --version | egrep -o "[[:digit:]]{1,}\.[[:digit:]]{1,}"`

 case "$m" in
	3.9)
	;;
	[4-9].*)
	;;

	*)
	echo "$NAM: Make($m) tool too old?" 1>&2
	echo "$NAM: ($n $v)" 1>&2
	echo "$NAM: Set *both* MAKE= and PATH=" 1>&2
	exit 1
	;;
 esac
}
fcp_chk_make

case "$TGT_NAM" in
	arm)
	TGT_ARCH="arm"
	TGT="${TGT_ARCH}-linux-gnueabihf"
	;;

	arm64)
	TGT_ARCH="aarch64"
	TGT="${TGT_ARCH}-linux-gnu"
	;;

	*)
	echo "$NAM: TGT_NAM?" 1>&2
	exit 1
	;;
esac

BU_CFG="
--disable-multilib
--with-fpu=vfp
--with-float=hard
--target=${TGT}
"

BU_32_CFG="
--with-arch=armv6
"
BU_64_CFG="
--with-arch=arm64
"

GC_CFG="
--enable-languages=c,c++
--disable-multilib
--target=${TGT}
"

GC_32_CFG="
--with-arch=armv6
--with-fpu=vfp
--with-float=hard
"
GC_64_CFG="
"

LC_CFG="
--disable-multilib
--with-fpu=vfp
--with-float=hard
--build=$MACHTYPE
--host=${TGT}
--target=${TGT}
libc_cv_forced_unwind=yes
"

LC_32_CFG="
--with-arch=armv6
"
LC_64_CFG="
--with-arch=arm64
"

case "$TGT_NAM" in
	arm)
BU_CFG="
${BU_CFG}
${BU_32_CFG}
"
GC_CFG="
${GC_CFG}
${GC_32_CFG}
"
LC_CFG="
${LC_CFG}
${LC_32_CFG}
"
	;;

	arm64)
BU_CFG="
${BU_CFG}
${BU_64_CFG}
"
GC_CFG="
${GC_CFG}
${GC_64_CFG}
"
LC_CFG="
${LC_CFG}
${LC_64_CFG}
"
	;;

	*)
	;;
esac
LK_CFG=

fcp_init ()
{
 unset INS SRC GEN OBJ PFX
 f_go_init
}

fcp_arc ()
{
 [ -d "$SRC" ] && return 0
 f_go_arc "$@"
}

fcp_gen ()
{
 f_go_gen
}

fcp_cfg ()
{
 f_go_cfg "$@"
}

fcp_mak ()
{
 f_go_mak "$@"
}

fcp_ins ()
{
 f_go_ins "$@"
}

fcp_rem ()
{
 f_go_rem "$@"
}

fcp_del ()
{
 f_go_del "$@"
}

fcp_bu_main ()
{
 PKG="$BU_PKG"
 VER="$BU_VER"
 fcp_init
 PFX="$D_RPI""/""$TGT"
CFG="
${BU_CFG}
"
 case "$1" in
	here)
	f_go_here
	exit 0
	;;

	arc)
	shift
	fcp_arc "$@" "$SRC"
	;;

	cfg)
	shift
	fcp_cfg "$@"
	;;

	mak)
	shift
	fcp_mak $NPROC "$@"
	;;

	ins)
	shift
	fcp_ins "$@"
	;;

	del)
	shift
	fcp_del "$@"
	;;

	all)
	fcp_arc -d "$SRC" || exit 1
	fcp_cfg || exit 1
	fcp_mak $NPROC || exit 1
	fcp_ins || exit 1
	fcp_del all
	;;

	*)
	;;
 esac
}

fcp_lk_mak ()
{
 (
 cd "$SRC"
 make "$@" ARCH="$TGT_NAM" INSTALL_HDR_PATH="$PFX/$TGT" headers_install
 )
}

fcp_lk_main ()
{
 PKG="$LK_PKG"
 VER="$LK_VER"
 fcp_init
 PFX="$D_RPI""/""$TGT"
CFG="
${LK_CFG}
"
 case "$1" in
	arc)
	shift
	fcp_arc "$@" "$SRC"
	;;

	mak)
	shift
	fcp_lk_mak "$@"
	;;

	del)
	shift
	fcp_del "$@"
	;;

	all)
	fcp_arc -d "$SRC" || exit 1
	fcp_lk_mak
	fcp_del all
	;;

	*)
	;;
 esac
}

fcp_gc_arc ()
{
 f_go_arc "$@"

 case "$1" in
	-d)
	f_go_gcc_req
	;;

	*)
	;;
 esac
}

fcp_gc_cfg ()
{
 local i

 (
 cd "$REQ" || exit 1
 for i in *.tar.bz2
 do
        tar xvjf "$i"
 done
 for i in *.tar.gz
 do
        tar xvzf "$i"
 done
 ) || exit 1
 (
 cd "$SRC" || exit 1
 ln -sf "$REQ"/gmp-*/ gmp
 ln -sf "$REQ"/mpfr-*/ mpfr
 ln -sf "$REQ"/mpc-*/ mpc
 ln -sf "$REQ"/isl-*/ isl
 ) || exit 1

 f_go_cfg "$@"
}

fcp_gc_del ()
{
 f_go_gcc_req_del "$1"
 case "$1" in
        all)
        fcp_gc_del obj
        fcp_gc_del src
        ;;

        *)
        ;;
 esac
 f_go_del "$@"
}

fcp_gc_main ()
{
 local	p

 PKG="$GC_PKG"
 VER="$GC_VER"
 fcp_init
 PFX="$D_RPI""/""$TGT"
CFG="
${GC_CFG}
--with-headers=${PFX}/${TGT}/include/linux
"

 p="$PFX"
 PATH="$p""/bin:""$PATH"
 LD_LIBRARY_PATH="$p""/lib64:""$p""/lib32:""$p""/lib"
 export PATH LD_LIBRARY_PATH
 gcc -v >/dev/null 2>&1
 [ $? -eq 127 ] && {
        echo "$NAM: No Compiler!" 1>&2
        echo "$PATH" 1>&2
        echo "$LD_LIBRARY_PATH" 1>&2
        exit 1
 }

 case "$1" in
	arc)
	shift
	fcp_gc_arc "$@" "$SRC"
	;;

	cfg)
	shift
	fcp_gc_cfg "$@"
	;;

	mak00)
	shift
	fcp_mak "$@" all-gcc || exit 1
	fcp_mak install-gcc
	;;

	mak01)
	shift
	fcp_mak "$@" all-target-libgcc || exit 1
	fcp_mak install-target-libgcc
	;;

	mak02)
	shift
	fcp_mak "$@" all || exit 1
	fcp_mak install
	rm -rf "$PFX/$TGT/sys-include"
	;;

	del)
	shift
	fcp_gc_del "$@"
	;;

	*)
	;;
 esac
}

fcp_lc_mak00 ()
{
 local	i

 fcp_mak "$@" install-bootstrap-headers=yes install-headers || exit 1
 fcp_mak "$@" csu/subdir_lib || exit 1
 for i in csu/crt1.o csu/crti.o csu/crtn.o
 do
        echo install -c -m 0644 "$OBJ"/"$i" "$PFX/$TGT"/lib
        install -c -m 0644 "$OBJ"/"$i" "$PFX/$TGT"/lib
 done
 "$TGT"-gcc  -nostdlib -nostartfiles -shared -x c /dev/null \
        -o "$PFX/$TGT"/lib/libc.so \
        || exit 1
 touch "$PFX/$TGT"/include/gnu/stubs.h || exit 1
}

fcp_lc_main ()
{
 local	p

 PKG="$LC_PKG"
 VER="$LC_VER"
 fcp_init
 PFX="$D_RPI""/""$TGT"
CFG="
${LC_CFG}
--prefix=${PFX}/${TGT}
--with-headers=${PFX}/${TGT}/include
"

 p="$PFX"
 PATH="$p""/bin:""$PATH"
 LD_LIBRARY_PATH="$p""/lib64:""$p""/lib32:""$p""/lib"
 export PATH LD_LIBRARY_PATH
 gcc -v >/dev/null 2>&1
 [ $? -eq 127 ] && {
        echo "$NAM: No Compiler!" 1>&2
        echo "$PATH" 1>&2
        echo "$LD_LIBRARY_PATH" 1>&2
        exit 1
 }

 case "$1" in
	arc)
	shift
	fcp_arc "$@" "$SRC"
	;;

	cfg)
	shift
	fcp_cfg "$@"
	;;

	mak00)
	shift
	fcp_lc_mak00 "$@"
	;;

	mak01)
	shift
	fcp_mak "$@"
	fcp_mak install
	;;

	del)
	shift
	fcp_del "$@"
	;;

	*)
	;;
 esac
}

fcp_all ()
{
 rm -rf "$D_RPI""/""$TGT"
 fcp_bu_main all || exit 1
 fcp_lk_main all || exit 1
 fcp_gc_main arc -d || exit 1
 fcp_gc_main cfg || exit 1
 fcp_gc_main mak00 $NPROC || exit 1
 fcp_lc_main arc -d || exit 1
 fcp_lc_main cfg || exit 1
 fcp_lc_main mak00 $NPROC || exit 1
 fcp_gc_main mak01 $NPROC || exit 1
 fcp_lc_main mak01 $NPROC || exit 1
 fcp_gc_main mak02 $NPROC || exit 1

 tar -C / -cvjf "BIN/""$TGT""(""$GC_PKG""-""$GC_VER"").tar.bz2" "$D_RPI""/""$TGT"
 fcp_gc_main del all
 fcp_lc_main del all
}

fcp_main ()
{
 f_go_time_b
 case "$1" in
	bu)
	shift
	fcp_bu_main "$@"
	;;

	lk)
	shift
	fcp_lk_main "$@"
	;;

	gc)
	shift
	fcp_gc_main "$@"
	;;

	lc)
	shift
	fcp_lc_main "$@"
	;;

	all)
	shift
	fcp_all
	;;

	*)
	;;
 esac
 f_go_time_e
 f_go_time
}

fcp_main "$@"
..and I've not even included all the junk from $SUB (which is even bigger).

The above only builds the compiler. You still have to build all the dev stuff for whatever you're buiding.

Heater
Posts: 18533
Joined: Tue Jul 17, 2012 3:02 pm

Re: C++ development for the Raspberry

Fri Jul 30, 2021 8:22 am

swampdog wrote:
Fri Jul 30, 2021 12:56 am
fudge=hack (but more politely ;-))
What on Earth is impolite about "hack"?

Hacking is one of the noblest traditions around here and in computing/programming on general. Not to mention other places.

Also I don't think you meant to mean "to hack 'distcc'". Surely you meant something like "setup", "configure" or even just "use"?
Memory in C++ is a leaky abstraction .

tttapa
Posts: 70
Joined: Mon Apr 06, 2020 2:52 pm

Re: C++ development for the Raspberry

Sat Jul 31, 2021 11:14 pm

I've posted my cross-compilation workflow here: Ubuntu to Raspberry Pi OS Cross C++ Development

It's quite simple, really, you just create a Raspberry Pi OS sysroot using mk-sbuild (based on debootstrap), and then you can just install Raspberry Pi libraries to it using apt-get install and keep it up to date using apt-get upgrade. (E.g. to install wiringPi on your computer, you just use 'sudo sbuild-apt rpizero-buster-armhf apt-get install wiringpi', but do keep in mind that wiringPi is deprecated.)
Then all you need is a cross-compilation toolchain, and you're good to go. CMake makes the build process relatively painless, and you can just use the provided Raspberry Pi toolchain file.

There are some more intermediate steps involved, of course, but that's the main idea, and once you have it set up, it's really easy to use, cross-compiling and debugging become almost identical to native development.

Whichever development strategy you use, I'd highly recommend having a clear boundary between the “standard” C++ code and the Pi-specific hardware-related code. This makes it much easier to quickly test things on your build computer without deploying to the Pi, running unit tests on a CI server, etc. If hardware is an essential part of your application you can even implement a simple mock layer for use in tests.

Distcc is a great tool, and it does indeed speed up the compilation, but in my experience it's still significantly slower than direct cross-compilation.

swampdog
Posts: 764
Joined: Fri Dec 04, 2015 11:22 am

Re: C++ development for the Raspberry

Tue Aug 03, 2021 1:50 pm

Heater wrote:
Fri Jul 30, 2021 8:22 am
swampdog wrote:
Fri Jul 30, 2021 12:56 am
fudge=hack (but more politely ;-))
What on Earth is impolite about "hack"?

Hacking is one of the noblest traditions around here and in computing/programming on general. Not to mention other places.

Also I don't think you meant to mean "to hack 'distcc'". Surely you meant something like "setup", "configure" or even just "use"?
I thought the OP might be confusing "fudge/fudging" to be some kind of tool. They can google "distcc" but they wouldn't get very far with "fudge". Seemed like an easy way to get the idea across.

Brian Beuken
Posts: 400
Joined: Fri Jan 29, 2016 12:51 pm

Re: C++ development for the Raspberry

Tue Aug 10, 2021 1:37 pm

When you say Visual Studio? Do you mean VS community or Pro on running on PC?

If so its very very easy to code on your Pi as long as you have the PC and Pi on a network and when you installed VS you ticked the Linux development with C++ box..

This allows you to write, edit and debug code on your PC, though the code itself is sent to your Pi to be compiled by GCC.
There is even a bit of demo code as a default project to get your Pi to flash its LED.

You could also install a plugin called VisualGDB (free for 30 days, quite cheap after) that lets you do full cross compile, but probably overkill for small prioejcts.

If you mean Visual Studio Code running on the Pi...well I'm not a fan, it takes too much time to set up and I find it too fussy, I prefer code:blocks which is a fully functioning C++ (and others) IDE that works fine directly on even the most modest Pi and can be installed with sudo apt-get install codeblocks
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
http://www.scratchpadgames.net/
https://www.patreon.com/BrianBeuken

Return to “C/C++”