Error of clang-14: error: linker command failed with exit code 1 (use -v to see invocation) in macOS
elsagong opened this issue · 4 comments
I tried to run a demo of [pulsar-client-go](https://github.com/apache/pulsar-client-go)
on macOS, but I always get the error of # github.com/99designs/go-keychain ld: framework not found CoreFoundation clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
,
after I
export CGO_CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
on console,
I got error as below
`# runtime/cgo
the code can run successfully in Linux, Does pulsar-client-go not work on MacOS?
Xcode 14.2
macOS 12.6.6
Thanks so much for any feedback.
I have the same problem.
go version go1.17.3 darwin/amd64
github.com/apache/pulsar-client-go v0.10.0
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
duplicate symbol '_CFDictionaryCreateSafe2' in:
/var/folders/jw/738hqc1x41n0dgcx9c2837500000gn/T/go-link-571816323/000019.o
/var/folders/jw/738hqc1x41n0dgcx9c2837500000gn/T/go-link-571816323/000072.o
duplicate symbol '_CFArrayCreateSafe2' in:
/var/folders/jw/738hqc1x41n0dgcx9c2837500000gn/T/go-link-571816323/000019.o
/var/folders/jw/738hqc1x41n0dgcx9c2837500000gn/T/go-link-571816323/000072.o
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Which demo did you run? Can you provide the details of reproduce steps?
@tisonkun And after I export CGO_CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
on console, I got error as below
# runtime/cgo ld: library not found for -lpthread clang-14: error: linker command failed with exit code 1 (use -v to see invocation)