add cgo example; fix zig url
This commit is contained in:
@@ -11,3 +11,5 @@ cc_binary(
|
||||
name = "exception",
|
||||
srcs = ["exception.cpp"],
|
||||
)
|
||||
|
||||
# go build -ldflags "-linkmode external -extldflags -static" hello.go
|
||||
|
||||
9
test/hello.go
Normal file
9
test/hello.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
// #include <stdio.h>
|
||||
// void helloworld() { printf("hello, world\n"); }
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
C.helloworld()
|
||||
}
|
||||
Reference in New Issue
Block a user