Skip to content

cmd/link: duplicate symbol reference pow on Windows #8756

@emidoots

Description

@emidoots
What does 'go version' print?
go version devel +ff82d3107ab3 Sun Aug 31 22:49:14 2014 -0400 windows/amd64

What steps reproduce the problem?

Create a program that uses math.h / pow function in two separate packages. Try to link
them together into one main program:

1. bug/bug.go: http://play.golang.org/p/nFkVRN6qN-
2. bug/one/one.go: http://play.golang.org/p/4e68AXsW1r
3. bug/two/two.go: http://play.golang.org/p/f3pNq-xniD
4. go install bug

What happened?
# bug
C:\Users\stephen\Desktop\godev\pkg\windows_amd64/bug/two.a(_all.o): duplicate symbol
reference: pow in both bug/one(.text) and bug/two(.text)

What should have happened instead?
The package should link properly.

Please provide any additional information below.

This is a simplified example of a bug I ran into recently. I have an application that
imports a CGO wrapper to the Chipmunk 2D physics engine and a CGO wrapper to GLFW. The
program links fine on Linux -- but I cannot build it on windows due to this issue.

FWIW I am using (TDM) MinGW-W64 4.8.1 rev2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions