mkdir build
cd build
cmake ../
cmake --build . --config=Release
在build/Release生成了 chiapos.lib
和gochiapos.lib
等文件
main.go
package main
// #cgo LDFLAGS: -LC:/code/chiapos/build/Release/ -lgochiapos
// int hello();
import "C"
import "fmt"
func main(){
fmt.Println(C.hello())
}