3 ms·
I don't have the source code in a good state to publish yet but here's where I'm at. At some point before this CGO_LDFLAGS does work and the header is found (om
by eatonphil 4y ago
I don't have the source code in a good state to publish yet but here's where I'm at. At some point before this CGO_LDFLAGS does work and the header is found (omit the -ldflags args). But when it goes to statically link it can no longer find the header.
CGO_LDFLAGS="-L$(pwd)/duckdb/src/include" CGO_CFLAGS="-I$(pwd)/duckdb/src/include" go build -ldflags '-extldflags " -lstdc++ -lm -lduckdb -static"'
# github.com/marcboeker/go-duckdb
../../go/pkg/mod/github.com/marcboeker/go-duckdb@v0.0.0-20220427142532-cd9f33e64d9a/connection.go:4:10: fatal error: duckdb.h: No such file or directory
4 | #include <duckdb.h>
| ^~~~~~~~~~
compilation terminated.
Edit, nevermind about not being in a good state! Here's my code: https://github.com/multiprocessio/duckdb-tests https://github.com/multiprocessio/duckdb-tests.
- irq-1 4y agoPut the file in quotes. Angle brackets are for built-in files. #include "duckdb.h"
- eatonphil 4y agoThat's not my code.
- eatonphil 4y agoBut also, just to double check, I modified the vendored code and no difference: CGO_LDFLAGS="-L$(pwd)/duckdb/src/include" CGO_CFLAGS="-I$(pwd)/duckdb/src/include" go build -ldflags '-extldflags " -lstdc++ -lm -lduckdb -static"' # github.com/marcboeker/go-duckdb vendor/github.com/marcboeker/go-duckdb/connection.go:4:10: fatal error: duckdb.h: No such file or directory 4 | #include "duckdb.h" | ^~~~~~~~~~ compilation terminated.