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

Open

#25.135 geöffnet am 20. März 2024

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C (5.002 Forks)batch import
help wantedquestion

Repository-Metriken

Stars
 (24.849 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 1h) (4 gemergte PRs in 30 T)

Beschreibung

在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 .....

Contributor Guide