Last active
December 18, 2015 04:39
-
-
Save sandro/5727227 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ACFunction() { | |
printf("ACFunction()\n"); | |
AGoFunction(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ACFunction(); | |
extern void AGoFunction(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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