-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cgo: multiple definition of cgo functions error when linking go-compiled c-archive library #20639
Comments
What are you really trying to do? |
@iangudger but the below simple example doesn't work either:
|
The simple example is an unfortunate limitation, but a documented one. Quoting https://golang.org/cmd/cgo/#hdr-C_references_to_Go:
|
Got it, thanks. |
What version of Go are you using (
go version
)?go version devel +c99483feb8 Sat Jun 3 17:04:56 2017 +0000 linux/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/reus"
GORACE=""
GOROOT="/home/reus/go"
GOTOOLDIR="/home/reus/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build884024617=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
lib.go
lib.c
build static library
call.go
build call.go
What did you expect to see?
no build error
What did you see instead?
The text was updated successfully, but these errors were encountered: