Я хочу вызвать C-код на Голанге:
// #cgo CFLAGS: -I/usr/include/c++/8.1.1/bits
// #cgo CXXFLAGS: -std=gnu++11
// #include "c++0x_warning.h"
import "C"
, но получаю ошибку:
In file included from ./main.go:5:
/usr/include/c++/8.1.1/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
Так что cgo не использует CXXFLAGS.Я пробовал -std=c++11
, и это тоже не работает.Что я делаю не так?
$ go version
go version go1.10.3 linux/amd64