Skip to content

macOS交叉编译linux失败 #247

@SkywardSky

Description

@SkywardSky

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions