Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# _/Users/larz/Programming/random
duplicate symbol __Z3addii in:
/var/folders/kz/fgkgncp17mg8t84dm5jjvzvm0000gn/T//go-link-Vas0Gn/000000.o
/var/folders/kz/fgkgncp17mg8t84dm5jjvzvm0000gn/T//go-link-Vas0Gn/000001.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/usr/local/go/pkg/tool/darwin_amd64/6l: running clang failed: unsuccessful exit status 0x100
#include "main.hh"
int add(int first, int second) {
return first + second;
}
package main
import "C"
func main() {
println(Add(1, 2))
}
#ifndef H_MAIN
#define H_MAIN 1
int add(int, int);
#endif
%module main
%{
#include "main.hh"
%}
%include "main.hh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment