Skip to content

Instantly share code, notes, and snippets.

@sandro
Last active December 18, 2015 04:39
Show Gist options
  • Save sandro/5727227 to your computer and use it in GitHub Desktop.
Save sandro/5727227 to your computer and use it in GitHub Desktop.
void ACFunction() {
printf("ACFunction()\n");
AGoFunction();
}
void ACFunction();
extern void AGoFunction();
# command-line-arguments
Undefined symbols for architecture x86_64:
"_ACFunction", referenced from:
__cgo_4032a8ce2271_Cfunc_ACFunction in wiki.cgo2.o
(maybe you meant: __cgo_4032a8ce2271_Cfunc_ACFunction)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
package main
import "fmt"
/*
#include <stdio.h>
#include "cfunc.h"
*/
import "C"
//export AGoFunction
func AGoFunction() {
fmt.Println("AGoFunction()")
}
func Example() {
C.ACFunction()
}
func main() {
fmt.Println("starting")
Example()
fmt.Println("ending")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment