ffi working. got a feel for it
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// example.c
|
||||
#include <stdio.h>
|
||||
|
||||
void helloFromC() {
|
||||
printf("Hello from C!\n");
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+12
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -L./ -lexample
|
||||
void helloFromC();
|
||||
*/
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
print("Hello from Go! calling FFI for C\n")
|
||||
C.helloFromC()
|
||||
}
|
||||
Reference in New Issue
Block a user