Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS交叉编译linux失败 #247

Open
SkywardSky opened this issue Mar 13, 2024 · 1 comment
Open

macOS交叉编译linux失败 #247

SkywardSky opened this issue Mar 13, 2024 · 1 comment

Comments

@SkywardSky
Copy link

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的可执行文件

@hellojukay
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants