what does the cgoflags.go do?
panchengtao opened this issue · 2 comments
panchengtao commented
Recently, I wrote a go program to call python 3.X code.I hava to declare the flowing code
//#cgo CFLAGS : -I./ -I/usr/include/python3.6
//#cgo LDFLAGS: -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -L/usr/lib -lpython3.6m -lpthread -ldl -lutil -lm
//#include "Python.h"
import "C"
And when I review your code, I do not know how you link to python.h and I can not find more answer when google.I think cgoflags.go is the keypoint, can you help me?
sbinet commented
cgo may be instructed to use pkg-config
to discover all the -I
, -l
and -L
compilation flags.
see:
hth
panchengtao commented
thx!