taosdata/TDengine

Using CGO on macOS, cross-compiled Linux binaries throw the error: github.com/taosdata/driver-go/v3@v3.5.1/wrapper/asynccb.go:7:10: fatal error: taos.h: No such file or directory

开放

#25,135 创建于 2024年3月20日

 (0 条评论) (0 个反应) (0 位负责人)C (5,002 个派生)batch import
help wantedquestion

仓库指标

星标
 (24,849 个星标)
PR 合并指标
 (平均合并 1天 1小时) (30 天内合并 4 个 PR)

描述

在mac平台,开启CGO,交叉编译linux二进制文件时,报错:

github.com/taosdata/driver-go/v3/wrapper

../../../../go/pkg/mod/github.com/taosdata/driver-go/v3@v3.5.1/wrapper/asynccb.go:7:10: fatal error: taos.h: No such file or directory 7 | #include <taos.h> | ^~~~~~~~

命令:CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=x86_64-linux-musl-gcc go build -trimpath -ldflags "-s -w -linkmode external -extldflags -static" -o .....

贡献者指南