driver-go icon indicating copy to clipboard operation
driver-go copied to clipboard

macOS交叉编译linux失败

Open SkywardSky opened this issue 11 months ago • 1 comments

macOS:14.4 Linux的C/C++交叉编译工具:FiloSottile/musl-cross/musl-cross taos-client:TDengine-client-3.2.1.0-macOS-x64

编译指令:CGO_ENABLED=1 CC="x86_64-linux-musl-gcc" CGO_CFLAGS=-I/usr/local/include GOOS=linux GOARCH=amd64 go build

结果报错: /usr/local/go/pkg/tool/darwin_amd64/link: running x86_64-linux-musl-gcc failed: exit status 1 /usr/local/Cellar/musl-cross/0.9.9_2/libexec/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/bin/ld: cannot find -ltaos collect2: error: ld returned 1 exit status

请问应该怎么操作才可以在macOS上交叉编译出linux的可执行文件

SkywardSky avatar Mar 13 '24 14:03 SkywardSky

涉及到了 C 库,不要在 Mac 上交叉编译。

hellojukay avatar Apr 29 '24 08:04 hellojukay