0

I am trying to run C++ code inside my go code. I figured out that I need -enable-cxx11 flag during compilation (because otherwise I get an error like here).

But somehow flags do not work:

/*
#cgo CPPFLAGS: -enable-cxx11
#include "cPackage/create_hyper_file_from_csv.cpp"
*/
import "C"

How do I use this flag?

MStikh
  • 368
  • 4
  • 21
  • I'd assume to provide it as command line argument, have you tried `go tool cgo -enable-cxx11`? – Aconcagua Mar 21 '22 at 11:04
  • unfortunately that does not work `flag provided but not defined: -enable-cxx11` – MStikh Mar 21 '22 at 13:29
  • Next attempt: https://stackoverflow.com/a/51109843/1312382 – I'd try both, identically as is or replacing `-std=c++11` with the flag in question – and finally both flags combined. If it's not that, I'm out of ideas, no go specialist... – Aconcagua Mar 21 '22 at 13:58

0 Answers0