Yesterday I managed to cross compile Hello World Go to the ARMv7 I did not realize Go supported it. I couldn’t install Go directly onto the board which took up all the space, the zip file itself took up a lot of space.

But I cross compiled it with this command:

env GOOS=linux GOARCH=arm go build -v hello

and then use scp to copy the executable.

scp hello root@s102:/home/root The Go server with https works now all I have to do is to call the C++ code. I’ve been looking at cgo and swig, they all seem to have a long and complicated process to it. I’m not sure how much space it’s going to take in the end but hopefully not too much. THe documentation is not easy to read and there are not a lot of tutorials around with the an updated version or even a tutorial with C++ since most of the tutorials are for C. This is going to take some time and reading but I am sure I can figure it out.

This gist has examples on cross compiling between C and Go https://gist.github.com/tejainece/8b243b56f9f1dadfc501#file-cgo2-c

Some more sample C++ with Go projects on github: https://github.com/zacg/simplelib