apecloud / myduckserver

MySQL & Postgres Analytics, Reimagined
187 stars 9 forks source link

Compile with CGO_ENABLED=0 fails #73

Closed weicao closed 2 months ago

weicao commented 2 months ago

$ CGO_ENABLED=0 make go build -ldflags "-X 'main.Version=f6a1d4b-dirty' -X 'main.BuildTime=2024-09-09T20:46:20+0800' -X 'main.GitCommit=f6a1d4b7336d6e65740057dfd9b27cd4119ce8fb'" -o myduckserver .

github.com/marcboeker/go-duckdb

../../go/pkg/mod/github.com/marcboeker/go-duckdb@v1.7.1/transaction.go:6:5: undefined: conn make: *** [myduckserver] Error 1

GaoYusong commented 2 months ago

go-duckdb requires cgo to link with duckdb.

go-duckdb uses CGO to make calls to DuckDB. You must build your binaries with CGO_ENABLED=1.

https://github.com/marcboeker/go-duckdb?tab=readme-ov-file#installation

weicao commented 2 months ago

I see