Re: [go-nuts] Re: cgo and Python as a shared library

2022-11-26 Thread Howard Waterfall
SOLVED! It took a while to sort out the various locations. Environment Variables: export LIBRARY_PATH=/usr/local/Frameworks/Python.framework/Versions/3.9/lib export PKG_CONFIG_PATH=/usr/local/Frameworks/Python.framework/Versions/3.9/lib/pkgconfig Code: ... package main /* #cgo

[go-nuts] Re: cgo and Python as a shared library

2022-11-23 Thread Deiter
Doh! I forgot the include. I get a linker error now: ... package main /* #cgo pkg-config: python3 #cgo LDFLAGS: -lpython3.8 #include */ import "C" import ( "fmt" ) func main() { C.Py_Initialize() fmt.Println(C.GoString(C.Py_GetVersion())) C.Py_Finalize() } ... $ go run . # producer