I probably had gcc-5 as the default compiler on my ubuntu system. Then I did change the default compiler (with update-alternative) so that gcc now invokes gcc-8 (same for g++).
I have some c++ code I try to bridge with cgo that relies on c++ 17. I try to build it this way
go build -x -o /home/fred/src/server/build/libcppgow.so -buildmode=c-shared main.go
The output shows me it is using g++-5 (and the build fails, of course). go env also shows:
Somehow, go does not want to use the default compiler. He might have cache somewhere the default compiler from an earlier invocation. Or it might use the compiler at the time I installed go (using brew).
What did you expect to see?
I expect the CC/CXX are inferred to be the default compiler of the platform.
If I'm wrong, then you should clearly document how CC/CXX are inferred.
The text was updated successfully, but these errors were encountered: