ffi working. got a feel for it

This commit is contained in:
talksik
2023-11-21 09:34:31 -08:00
parent 61a43bd732
commit 255c7b7fed
9 changed files with 36 additions and 3 deletions
+7
View File
@@ -0,0 +1,7 @@
// example.c
#include <stdio.h>
void helloFromC() {
printf("Hello from C!\n");
}
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+12
View File
@@ -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()
}