Re: [go-nuts] go build error in darwin: duplicate symbol

2023-01-09 Thread Xie Zhenye
Maybe cgo should build a single .o file for the same .c file. On Tuesday, January 10, 2023 at 11:21:00 AM UTC+8 Xie Zhenye wrote: > It's caused by github.com/lufia/iostat. > > Maybe two different dependencies used 'iostat'. 'iostat; used cgo, and > produced an object file from .c file for each de

Re: [go-nuts] go build error in darwin: duplicate symbol

2023-01-09 Thread Xie Zhenye
It's caused by github.com/lufia/iostat. Maybe two different dependencies used 'iostat'. 'iostat; used cgo, and produced an object file from .c file for each dependency. Linker try to link both .o file that cause the problem. On Tuesday, March 23, 2021 at 12:25:17 AM UTC+8 Ian Lance Taylor wrote

Re: [go-nuts] go build error in darwin: duplicate symbol

2021-03-22 Thread Ian Lance Taylor
On Mon, Mar 22, 2021 at 7:40 AM Alex wrote: > > A package you import could be using cgo, you don't have to be using it > directly. I'll add that I think that this must be what is happening, as you could not get that error message in a program that doesn't use cgo anywhere. Ian -- You received

Re: [go-nuts] go build error in darwin: duplicate symbol

2021-03-22 Thread Alex
A package you import could be using cgo, you don't have to be using it directly. If you run `GOOS=linux go build` on a mac, that is cross compileing and cgo is disabled by default. You can try `CGO_ENABLED=0 go build` and if it works then it is cgo related. >From the error messages, it looks lik

Re: [go-nuts] go build error in darwin: duplicate symbol

2021-03-22 Thread Max Xu
But I didn't write cgo code in my project. The weird part is I can build success with *GOOS=linux go build*, but failed with *GOOS=darwin go build* On Friday, March 19, 2021 at 5:11:57 AM UTC+8 Ian Lance Taylor wrote: > On Thu, Mar 18, 2021 at 9:55 AM Max Xu wrote: > > > > I'm running into a w

Re: [go-nuts] go build error in darwin: duplicate symbol

2021-03-18 Thread Ian Lance Taylor
On Thu, Mar 18, 2021 at 9:55 AM Max Xu wrote: > > I'm running into a weird bug: > > Failed with command: > GOOS=darwin go build > > Bug success with: > GOOS=linux go build > > The failed Message: > > /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running clang failed: > exit status 1 > dup

[go-nuts] go build error in darwin: duplicate symbol

2021-03-18 Thread Max Xu
Hi all, I'm running into a weird bug: Failed with command: GOOS=darwin go build Bug success with: GOOS=linux go build The failed Message: /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1 duplicate symbol '_readdrivestat' in: /var/folders/tx/5c8vkq