Skip to content
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

cmd/cgo: duplicate symbol #3116

Closed
gopherbot opened this issue Feb 23, 2012 · 4 comments
Closed

cmd/cgo: duplicate symbol #3116

gopherbot opened this issue Feb 23, 2012 · 4 comments
Milestone

Comments

@gopherbot
Copy link

by giacomo.tartari:

What steps will reproduce the problem?
I don't have an ad hoc example but I stumbled upon the issue while go getting a githhub
repo so the code is there. 
1.
$ go get github.com/jteeuwen/glfw


What is the expected output?

$

What do you see instead?

# github.com/jteeuwen/glfw
ld: duplicate symbol _setCharCB in $WORK/github.com/jteeuwen/glfw/_obj/glfw.cgo2.o and
$WORK/github.com/jteeuwen/glfw/_obj/_cgo_export.o for architecture x86_64
collect2: ld returned 1 exit status

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?

$ uname -rs
Darwin 11.3.0

Which revision are you using?  (hg identify)

$ hg identify
96bd78e7d35e weekly/weekly.2012-02-22

$ go version
go version weekly.2012-02-22 +96bd78e7d35e

Please provide any additional information below.

more details here:
https://groups.google.com/d/msg/golang-nuts/_HKIFbWX0Co/dwASE-SGPXIJ
@rsc
Copy link
Contributor

rsc commented Feb 23, 2012

Comment 1:

What is setCharCB (or _setCharCB?)  I don't see it defined in glue.h,
but the bug must becaused by including glue.h in _cgo_export.h now
(this is new behavior).

Labels changed: added priority-go1, removed priority-triage.

Owner changed to builder@golang.org.

Status changed to Accepted.

@gopherbot
Copy link
Author

Comment 2 by jimteeuwen:

'setCharCB' is defined in line 25 of
https://github.com/jteeuwen/glfw/blob/master/callback.go as:
    // void setCharCB() { glfwSetCharCallback(goCharCB); }
and only called from line 195 in the same file as:
    C.setCharCB()
Where the linker gets the underscored version from is unknown to me.

@rsc
Copy link
Contributor

rsc commented Feb 23, 2012

Comment 3:

Thanks for tracking that down.  That kind of definition
is no longer supported in cgo packages that use //export.
You should talk to the owner of that code to get it updated.
The change is documented in "The cgo command" section
here: http://weekly.golang.org/doc/go1.html#cmd_cgo
Russ

Status changed to WorkingAsIntended.

@gopherbot
Copy link
Author

Comment 4 by giacomo.tartari:

Thanks Russ and sorry for the noise.
Note to self: RTM.

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants