rakyll / portmidi

Go bindings for libportmidi
Apache License 2.0
286 stars 60 forks source link

Duplicate symbol messages on Apple Mac #37

Open carlca opened 7 years ago

carlca commented 7 years ago

Golang 1.9 macOS 10.12.6 Sierra

Hello, I ran brew install portmidi and that seemed to go OK. I then ran go get github.com/rakyll/portmidi - again, no cause for alarm.

I then cd'd to the rakyll/portmidi folder and ran go test. I received the following messages:

 carlca  ~/code/go/src/github.com/rakyll/portmidi  master  go test                                   ✓  10:26:17 - 05.09.2017
# testmain
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_Abort in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_Close in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_CountDevices in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_GetDefaultInputDeviceID in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_GetDefaultOutputDeviceID in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_GetDeviceInfo in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_GetErrorText in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_Initialize in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_OpenInput in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_OpenOutput in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_Poll in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_Read in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_SetChannelMask in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_Terminate in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_Write in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pm_WriteSysEx in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pt_Start in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pt_Stop in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
duplicate symbol __cgo_d8e63e9abae4_Cfunc_Pt_Time in:
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000000.o
    /var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-link-946891097/000002.o
ld: 19 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

FAIL    _/Users/carlca/code/go/src/github.com/rakyll/portmidi [build failed]

Any ideas what the problem could be? Cheers, Carl.

brettbuddin commented 7 years ago

Could you provide a dump of what your env output is?

carlca commented 7 years ago

Sure, here it is:

GOARCH="amd64"
GOBIN="/Users/carlca/Code/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/carlca/Code/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1d/1rqcnlq51zd4j_vqhp1kv3540000gp/T/go-build904452756=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"