marcboeker / go-duckdb

go-duckdb provides a database/sql driver for the DuckDB database engine.
MIT License
646 stars 97 forks source link

Windows compiling error with "_access_s" error #97

Open dawsondong opened 1 year ago

dawsondong commented 1 year ago

On my local windows environment, compiling any simple test go program with TDM-GCC-64 compiler will get error like the following. I did not get any similar error from other after searching. Could you please have it a look?

github.com/marcboeker/go-duckdb

duckdb.cpp: In function 'bool duckdb_httplib::detail::is_file(const string&)': duckdb.cpp:160873:34: error: '_access_s' was not declared in this scope return _access_s(path.c_str(), 0) == 0; ^

cc1plus.exe: out of memory allocating 65536 bytes

davealexis commented 2 months ago

Please add proper support for Windows.

rusco commented 2 months ago

Might help: https://github.com/marcboeker/go-duckdb/issues/4#issuecomment-2176409066

davealexis commented 1 month ago

Nope. Does not work. Tried it on multiple Windows machines with the same problem.

Attempts to build fail, saying the malloc doesn't exist. Some googling on the error led to the issue being that stdio needed to be included, since that's where malloc is defined. I was able to get it to build by including stdio.h many of the Go files that include duckdb.h.

An executable at least builds now, but just ends when the sql.Open() call is made. No panic, no error. Just ends.