- Put
cinterface.go
,cinterface.c
andtest.h
in~/go/src/cinterface/
- Then call
go build -buildmode=c-archive cinterface
, this will producecinterface.a
andcinterface.h
in current directory - Put
main.c
andtest.h
in current directory and callgcc -o main -I. cinterface.a main.c
, this will produce final binary