Duckdb: `Make` fails on Windows: recipe for target 'debug' failed

Created on 27 Nov 2020  路  28Comments  路  Source: cwida/duckdb

Sorry for pestering with frequent problems but I don't seem to be able to build DuckDb on Windows using MingW. It throws me the error. While on Mac it is perfectly fine. Any pointers?

cmake       - DBUILD_PARQUET_EXTENSION=TRUE -DCMAKE_BUILD_TYPE=Debug ../.. & \
cmake --build .
The syntax of the command is incorrect.
Makefile:61: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 1

Most helpful comment

I had a brief look and can confirm I get the same errors on Windows. The errors are in the dynamic sqlite3_api_wrapper which is actually not used in the system. For now I have pushed a fix that simply disables compiling this since it is not required and have also added a switch to disable compilation of the shell (#1192). These errors should not actually matter, though, since the regular library and shell does still seem to get build correctly.

All 28 comments

Try adding -G "MinGW Makefiles" to your cmake invocation.

Did you mean cmake --build -G "MinGW Makefiles" .? It did not work though

No, try cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug ../..
and then
cmake --build .

I tried these but the result is the same (get the same build errors)

debug:
    mkdir -p build/debug && \
    cd build/debug && \
    cmake $(GENERATOR) $(FORCE_COLOR) ${WARNINGS_AS_ERRORS} ${DISABLE_UNITY_FLAG} ${DISABLE_SANITIZER_FLAG} ${STATIC_LIBCPP} ${EXTENSIONS} -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug ../.. && \
    cmake --build .

And also

debug:
    mkdir -p build/debug && \
    cd build/debug && \
    cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug ../..
    cmake --build .

To confirm, you still get "The syntax of the command is incorrect.", right?

And are you running this from the standard windows shell, git bash or something of the like?

Yes. I am getting syntax incorrect message and using standard windows shell

And why are you using MinGW if I may ask?

Well I did try nmake and mingw32-make both. Also, I would have preferred nmake. But, decided to go with mingw because it compiled well on Linux

Please suggest if there are other options

On Windows we usually compile with VisualStudio. This can be done through cmake.

Alright. I will check and update. Thanks for that

Also, any reason you cannot use the binaries for Windows that we provide?

Well I need parquet binary that's why i need to compile the project

I get the following error when building on Visual studio 2019

Steps

  1. Open the Project using VS2019 CMake
  2. Run CMake
  3. Build All
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::Value::Value(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Value@duckdb@@QEAA@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function sqlite3_bind_text
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static class duckdb::Value __cdecl duckdb::Value::INTEGER(int)" (?INTEGER@Value@duckdb@@SA?AV12@H@Z) referenced in function sqlite3_bind_int
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static class duckdb::Value __cdecl duckdb::Value::BIGINT(__int64)" (?BIGINT@Value@duckdb@@SA?AV12@_J@Z) referenced in function sqlite3_bind_int64
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static class duckdb::Value __cdecl duckdb::Value::DOUBLE(double)" (?DOUBLE@Value@duckdb@@SA?AV12@N@Z) referenced in function sqlite3_bind_double
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class duckdb::Value __cdecl duckdb::Value::CastAs(struct duckdb::LogicalType,bool)const " (?CastAs@Value@duckdb@@QEBA?AV12@ULogicalType@2@_N@Z) referenced in function "bool __cdecl sqlite3_column_has_value(struct sqlite3_stmt *,int,struct duckdb::LogicalType,class duckdb::Value &)" (?sqlite3_column_has_value@@YA_NPEAUsqlite3_stmt@@HULogicalType@duckdb@@AEAVValue@3@@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class duckdb::Value __cdecl duckdb::Vector::GetValue(unsigned __int64)const " (?GetValue@Vector@duckdb@@QEBA?AVValue@2@_K@Z) referenced in function "bool __cdecl sqlite3_column_has_value(struct sqlite3_stmt *,int,struct duckdb::LogicalType,class duckdb::Value &)" (?sqlite3_column_has_value@@YA_NPEAUsqlite3_stmt@@HULogicalType@duckdb@@AEAVValue@3@@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::PreparedStatement::~PreparedStatement(void)" (??1PreparedStatement@duckdb@@QEAA@XZ) referenced in function "public: void * __cdecl duckdb::PreparedStatement::`scalar deleting destructor'(unsigned int)" (??_GPreparedStatement@duckdb@@QEAAPEAXI@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class std::unique_ptr<class duckdb::QueryResult,struct std::default_delete<class duckdb::QueryResult> > __cdecl duckdb::PreparedStatement::Execute(class std::vector<class duckdb::Value,class std::allocator<class duckdb::Value> > &,bool)" (?Execute@PreparedStatement@duckdb@@QEAA?AV?$unique_ptr@VQueryResult@duckdb@@U?$default_delete@VQueryResult@duckdb@@@std@@@std@@AEAV?$vector@VValue@duckdb@@V?$allocator@VValue@duckdb@@@std@@@4@_N@Z) referenced in function sqlite3_step
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::Connection::Connection(class duckdb::DuckDB &)" (??0Connection@duckdb@@QEAA@AEAVDuckDB@1@@Z) referenced in function "class std::unique_ptr<class duckdb::Connection,struct std::default_delete<class duckdb::Connection> > __cdecl std::make_unique<class duckdb::Connection,class duckdb::DuckDB &,0>(class duckdb::DuckDB &)" (??$make_unique@VConnection@duckdb@@AEAVDuckDB@2@$0A@@std@@YA?AV?$unique_ptr@VConnection@duckdb@@U?$default_delete@VConnection@duckdb@@@std@@@0@AEAVDuckDB@duckdb@@@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::Connection::~Connection(void)" (??1Connection@duckdb@@QEAA@XZ) referenced in function "public: void * __cdecl duckdb::Connection::`scalar deleting destructor'(unsigned int)" (??_GConnection@duckdb@@QEAAPEAXI@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl duckdb::Connection::Interrupt(void)" (?Interrupt@Connection@duckdb@@QEAAXXZ) referenced in function sqlite3_interrupt
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class std::unique_ptr<class duckdb::MaterializedQueryResult,struct std::default_delete<class duckdb::MaterializedQueryResult> > __cdecl duckdb::Connection::Query(class std::unique_ptr<class duckdb::SQLStatement,struct std::default_delete<class duckdb::SQLStatement> >)" (?Query@Connection@duckdb@@QEAA?AV?$unique_ptr@VMaterializedQueryResult@duckdb@@U?$default_delete@VMaterializedQueryResult@duckdb@@@std@@@std@@V?$unique_ptr@VSQLStatement@duckdb@@U?$default_delete@VSQLStatement@duckdb@@@std@@@4@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class std::unique_ptr<class duckdb::PreparedStatement,struct std::default_delete<class duckdb::PreparedStatement> > __cdecl duckdb::Connection::Prepare(class std::unique_ptr<class duckdb::SQLStatement,struct std::default_delete<class duckdb::SQLStatement> >)" (?Prepare@Connection@duckdb@@QEAA?AV?$unique_ptr@VPreparedStatement@duckdb@@U?$default_delete@VPreparedStatement@duckdb@@@std@@@std@@V?$unique_ptr@VSQLStatement@duckdb@@U?$default_delete@VSQLStatement@duckdb@@@std@@@4@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::DBConfig::~DBConfig(void)" (??1DBConfig@duckdb@@QEAA@XZ) referenced in function sqlite3_open_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::DuckDB::DuckDB(char const *,struct duckdb::DBConfig *)" (??0DuckDB@duckdb@@QEAA@PEBDPEAUDBConfig@1@@Z) referenced in function "class std::unique_ptr<class duckdb::DuckDB,struct std::default_delete<class duckdb::DuckDB> > __cdecl std::make_unique<class duckdb::DuckDB,char const * &,struct duckdb::DBConfig *,0>(char const * &,struct duckdb::DBConfig * &&)" (??$make_unique@VDuckDB@duckdb@@AEAPEBDPEAUDBConfig@2@$0A@@std@@YA?AV?$unique_ptr@VDuckDB@duckdb@@U?$default_delete@VDuckDB@duckdb@@@std@@@0@AEAPEBD$$QEAPEAUDBConfig@duckdb@@@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::DuckDB::~DuckDB(void)" (??1DuckDB@duckdb@@QEAA@XZ) referenced in function "public: void * __cdecl duckdb::DuckDB::`scalar deleting destructor'(unsigned int)" (??_GDuckDB@duckdb@@QEAAPEAXI@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static char const * __cdecl duckdb::DuckDB::SourceID(void)" (?SourceID@DuckDB@duckdb@@SAPEBDXZ) referenced in function sqlite3_sourceid
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static char const * __cdecl duckdb::DuckDB::LibraryVersion(void)" (?LibraryVersion@DuckDB@duckdb@@SAPEBDXZ) referenced in function sqlite3_libversion
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::Parser::Parser(void)" (??0Parser@duckdb@@QEAA@XZ) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl duckdb::Parser::ParseQuery(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?ParseQuery@Parser@duckdb@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static bool __cdecl duckdb::Parser::IsKeyword(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?IsKeyword@Parser@duckdb@@SA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function sqlite3_keyword_check
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::PragmaHandler::PragmaHandler(class duckdb::ClientContext &)" (??0PragmaHandler@duckdb@@QEAA@AEAVClientContext@1@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl duckdb::PragmaHandler::HandlePragmaStatements(class std::vector<class std::unique_ptr<class duckdb::SQLStatement,struct std::default_delete<class duckdb::SQLStatement> >,class std::allocator<class std::unique_ptr<class duckdb::SQLStatement,struct std::default_delete<class duckdb::SQLStatement> > > > &)" (?HandlePragmaStatements@PragmaHandler@duckdb@@QEAAXAEAV?$vector@V?$unique_ptr@VSQLStatement@duckdb@@U?$default_delete@VSQLStatement@duckdb@@@std@@@std@@V?$allocator@V?$unique_ptr@VSQLStatement@duckdb@@U?$default_delete@VSQLStatement@duckdb@@@std@@@std@@@2@@std@@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::SQLNULL" (?SQLNULL@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::INTEGER" (?INTEGER@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::BIGINT" (?BIGINT@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::DOUBLE" (?DOUBLE@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::VARCHAR" (?VARCHAR@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\tools\sqlite3_api_wrapper\sqlite3_api_wrapper.dll : fatal error LNK1120: 28 unresolved externals

Please ship the libparquet_extension library file along with duckdb.dll. There are a lot of problems in building this project without the knowledge of right tools or provide the link to the right documentation. Other errors

  FAILED: third_party/re2/CMakeFiles/duckdb_re2.dir/re2/mimics_pcre.cc.obj 
  FAILED: third_party/re2/CMakeFiles/duckdb_re2.dir/re2/compile.cc.obj 

@chilarai Could you please start posting fully reproducible examples including environment (os, compiler, etc.) versions? If you are just throwing error messages at us it's hard to tell what's going on.

@hannesmuehleisen
Issue number 1: on Windows 10 64-bit

I cloned the repo from https://github.com/cwida/duckdb using Visual Studio 2019 (with CMake). Once, the repo is cloned and build (using Build > Build All), I receive the errors quoted. Please help me compile this as I wanted to try out parquet capabilities on Windows with DuckDb.

I get the following error when building on Visual studio 2019

Steps

  1. Open the Project using VS2019 CMake
  2. Run CMake
  3. Build All
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::Value::Value(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Value@duckdb@@QEAA@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function sqlite3_bind_text
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static class duckdb::Value __cdecl duckdb::Value::INTEGER(int)" (?INTEGER@Value@duckdb@@SA?AV12@H@Z) referenced in function sqlite3_bind_int
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static class duckdb::Value __cdecl duckdb::Value::BIGINT(__int64)" (?BIGINT@Value@duckdb@@SA?AV12@_J@Z) referenced in function sqlite3_bind_int64
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static class duckdb::Value __cdecl duckdb::Value::DOUBLE(double)" (?DOUBLE@Value@duckdb@@SA?AV12@N@Z) referenced in function sqlite3_bind_double
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class duckdb::Value __cdecl duckdb::Value::CastAs(struct duckdb::LogicalType,bool)const " (?CastAs@Value@duckdb@@QEBA?AV12@ULogicalType@2@_N@Z) referenced in function "bool __cdecl sqlite3_column_has_value(struct sqlite3_stmt *,int,struct duckdb::LogicalType,class duckdb::Value &)" (?sqlite3_column_has_value@@YA_NPEAUsqlite3_stmt@@HULogicalType@duckdb@@AEAVValue@3@@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class duckdb::Value __cdecl duckdb::Vector::GetValue(unsigned __int64)const " (?GetValue@Vector@duckdb@@QEBA?AVValue@2@_K@Z) referenced in function "bool __cdecl sqlite3_column_has_value(struct sqlite3_stmt *,int,struct duckdb::LogicalType,class duckdb::Value &)" (?sqlite3_column_has_value@@YA_NPEAUsqlite3_stmt@@HULogicalType@duckdb@@AEAVValue@3@@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::PreparedStatement::~PreparedStatement(void)" (??1PreparedStatement@duckdb@@QEAA@XZ) referenced in function "public: void * __cdecl duckdb::PreparedStatement::`scalar deleting destructor'(unsigned int)" (??_GPreparedStatement@duckdb@@QEAAPEAXI@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class std::unique_ptr<class duckdb::QueryResult,struct std::default_delete<class duckdb::QueryResult> > __cdecl duckdb::PreparedStatement::Execute(class std::vector<class duckdb::Value,class std::allocator<class duckdb::Value> > &,bool)" (?Execute@PreparedStatement@duckdb@@QEAA?AV?$unique_ptr@VQueryResult@duckdb@@U?$default_delete@VQueryResult@duckdb@@@std@@@std@@AEAV?$vector@VValue@duckdb@@V?$allocator@VValue@duckdb@@@std@@@4@_N@Z) referenced in function sqlite3_step
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::Connection::Connection(class duckdb::DuckDB &)" (??0Connection@duckdb@@QEAA@AEAVDuckDB@1@@Z) referenced in function "class std::unique_ptr<class duckdb::Connection,struct std::default_delete<class duckdb::Connection> > __cdecl std::make_unique<class duckdb::Connection,class duckdb::DuckDB &,0>(class duckdb::DuckDB &)" (??$make_unique@VConnection@duckdb@@AEAVDuckDB@2@$0A@@std@@YA?AV?$unique_ptr@VConnection@duckdb@@U?$default_delete@VConnection@duckdb@@@std@@@0@AEAVDuckDB@duckdb@@@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::Connection::~Connection(void)" (??1Connection@duckdb@@QEAA@XZ) referenced in function "public: void * __cdecl duckdb::Connection::`scalar deleting destructor'(unsigned int)" (??_GConnection@duckdb@@QEAAPEAXI@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl duckdb::Connection::Interrupt(void)" (?Interrupt@Connection@duckdb@@QEAAXXZ) referenced in function sqlite3_interrupt
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class std::unique_ptr<class duckdb::MaterializedQueryResult,struct std::default_delete<class duckdb::MaterializedQueryResult> > __cdecl duckdb::Connection::Query(class std::unique_ptr<class duckdb::SQLStatement,struct std::default_delete<class duckdb::SQLStatement> >)" (?Query@Connection@duckdb@@QEAA?AV?$unique_ptr@VMaterializedQueryResult@duckdb@@U?$default_delete@VMaterializedQueryResult@duckdb@@@std@@@std@@V?$unique_ptr@VSQLStatement@duckdb@@U?$default_delete@VSQLStatement@duckdb@@@std@@@4@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: class std::unique_ptr<class duckdb::PreparedStatement,struct std::default_delete<class duckdb::PreparedStatement> > __cdecl duckdb::Connection::Prepare(class std::unique_ptr<class duckdb::SQLStatement,struct std::default_delete<class duckdb::SQLStatement> >)" (?Prepare@Connection@duckdb@@QEAA?AV?$unique_ptr@VPreparedStatement@duckdb@@U?$default_delete@VPreparedStatement@duckdb@@@std@@@std@@V?$unique_ptr@VSQLStatement@duckdb@@U?$default_delete@VSQLStatement@duckdb@@@std@@@4@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::DBConfig::~DBConfig(void)" (??1DBConfig@duckdb@@QEAA@XZ) referenced in function sqlite3_open_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::DuckDB::DuckDB(char const *,struct duckdb::DBConfig *)" (??0DuckDB@duckdb@@QEAA@PEBDPEAUDBConfig@1@@Z) referenced in function "class std::unique_ptr<class duckdb::DuckDB,struct std::default_delete<class duckdb::DuckDB> > __cdecl std::make_unique<class duckdb::DuckDB,char const * &,struct duckdb::DBConfig *,0>(char const * &,struct duckdb::DBConfig * &&)" (??$make_unique@VDuckDB@duckdb@@AEAPEBDPEAUDBConfig@2@$0A@@std@@YA?AV?$unique_ptr@VDuckDB@duckdb@@U?$default_delete@VDuckDB@duckdb@@@std@@@0@AEAPEBD$$QEAPEAUDBConfig@duckdb@@@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::DuckDB::~DuckDB(void)" (??1DuckDB@duckdb@@QEAA@XZ) referenced in function "public: void * __cdecl duckdb::DuckDB::`scalar deleting destructor'(unsigned int)" (??_GDuckDB@duckdb@@QEAAPEAXI@Z)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static char const * __cdecl duckdb::DuckDB::SourceID(void)" (?SourceID@DuckDB@duckdb@@SAPEBDXZ) referenced in function sqlite3_sourceid
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static char const * __cdecl duckdb::DuckDB::LibraryVersion(void)" (?LibraryVersion@DuckDB@duckdb@@SAPEBDXZ) referenced in function sqlite3_libversion
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::Parser::Parser(void)" (??0Parser@duckdb@@QEAA@XZ) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl duckdb::Parser::ParseQuery(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?ParseQuery@Parser@duckdb@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: static bool __cdecl duckdb::Parser::IsKeyword(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?IsKeyword@Parser@duckdb@@SA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function sqlite3_keyword_check
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::PragmaHandler::PragmaHandler(class duckdb::ClientContext &)" (??0PragmaHandler@duckdb@@QEAA@AEAVClientContext@1@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl duckdb::PragmaHandler::HandlePragmaStatements(class std::vector<class std::unique_ptr<class duckdb::SQLStatement,struct std::default_delete<class duckdb::SQLStatement> >,class std::allocator<class std::unique_ptr<class duckdb::SQLStatement,struct std::default_delete<class duckdb::SQLStatement> > > > &)" (?HandlePragmaStatements@PragmaHandler@duckdb@@QEAAXAEAV?$vector@V?$unique_ptr@VSQLStatement@duckdb@@U?$default_delete@VSQLStatement@duckdb@@@std@@@std@@V?$allocator@V?$unique_ptr@VSQLStatement@duckdb@@U?$default_delete@VSQLStatement@duckdb@@@std@@@std@@@2@@std@@@Z) referenced in function sqlite3_prepare_v2
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::SQLNULL" (?SQLNULL@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::INTEGER" (?INTEGER@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::BIGINT" (?BIGINT@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::DOUBLE" (?DOUBLE@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\sqlite3_api_wrapper.cpp.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::VARCHAR" (?VARCHAR@LogicalType@duckdb@@2U12@B)
C:\Users\dev\Source\Repos\duckdb\out\build\x64-Debug\tools\sqlite3_api_wrapper\sqlite3_api_wrapper.dll : fatal error LNK1120: 28 unresolved externals

@hannesmuehleisen did you get to look into this issue and also please let me know if you need any other details

I'm getting the same errors as @chilarai trying to build on Windows. Using CMake, having tried both Ninja & Visual Studio generators and your 0.2.2 and 0.2.3 release, I always get:

5>------ Build started: Project: sqlite3_api_wrapper, Configuration: Debug x64 ------
5>sqlite3_api_wrapper.obj : error LNK2019: unresolved external symbol "public: __cdecl duckdb::Value::Value(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Value@duckdb@@QEAA@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function sqlite3_bind_text
5>sqlite3_api_wrapper.obj : error LNK2019: unresolved external symbol "public: static class duckdb::Value __cdecl duckdb::Value::INTEGER(int)" (?INTEGER@Value@duckdb@@SA?AV12@H@Z) referenced in function sqlite3_bind_int
...
5>sqlite3_api_wrapper.obj : error LNK2001: unresolved external symbol "public: static struct duckdb::LogicalType const duckdb::LogicalType::VARCHAR" (?VARCHAR@LogicalType@duckdb@@2U12@B)
5>C:\pSource\uncontrolled\duckdb\0.2.3\buildvs\tools\sqlite3_api_wrapper\Debug\sqlite3_api_wrapper.dll : fatal error LNK1120: 28 unresolved externals

Using CMake 3.18.1, Visual Studio 2019 16.8.2 (latest currently available), x64, Debug build. Are there any build steps or flags that we are missing?

I had a brief look and can confirm I get the same errors on Windows. The errors are in the dynamic sqlite3_api_wrapper which is actually not used in the system. For now I have pushed a fix that simply disables compiling this since it is not required and have also added a switch to disable compilation of the shell (#1192). These errors should not actually matter, though, since the regular library and shell does still seem to get build correctly.

That sounds like a good workaround for now. I'm trying to bundle duckdb into our conan package repository, so I'll apply that commit as a patch and see if that gets me further in my testing.

@Mytherin, I was looking to generate libparquet_extension (and if possible a working duckdb.lib) after compilation of the project which is still not happening. Can there be any workaround for this please.

Also, as a request I did earlier, can you ship the above mentioned files in your release versions so that we dont have to compile the project across various platforms.

@Mytherin, I was looking to generate libparquet_extension (and if possible a working duckdb.lib) after compilation of the project which is still not happening. Can there be any workaround for this please.

Are you enabling the BUILD_PARQUET_EXTENSION option? After applying my fix I have no problems building the entire project (including the parquet extension). It should be in build/extension/parquet/../parquet_extension.lib.

Also, as a request I did earlier, can you ship the above mentioned files in your release versions so that we dont have to compile the project across various platforms.

This is an outstanding issue (#1124). We will make this happen when we get to it, but it is not an immediate priority.

I'm guessing that those extensions are suffering from the same root cause as the sqlite3_api_wrapper?

As an aside, and I don't want to hijack this issue, I think I spotted another cmake bug - the main duckdb project install statement misses out the DLL install (CMake install targets RUNTIME)... current code is:

install(
  TARGETS duckdb duckdb_static
  EXPORT "${DUCKDB_EXPORT_SET}"
  LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
  ARCHIVE DESTINATION "${INSTALL_LIB_DIR}")

I'm guessing it should be more like:

install(
  TARGETS duckdb duckdb_static
  EXPORT "${DUCKDB_EXPORT_SET}"
  LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
  ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
  RUNTIME DESTINATION "{$INSTALL_BIN_DIR}")

Having said that, CMake's install has always been a bit of black art to me.
)

@Mytherin I have enabled option(BUILD_PARQUET_EXTENSION "Build the Parquet extension." TRUE) in CMakeLists.txt. But cannot find the extension inside _duckdb\outbuild\x64-Debug (default)\extension_ folder after successful build.

Any other place I need to change the settings ?

@Mytherin, I was looking to generate libparquet_extension (and if possible a working duckdb.lib) after compilation of the project which is still not happening. Can there be any workaround for this please.

Are you enabling the BUILD_PARQUET_EXTENSION option? After applying my fix I have no problems building the entire project (including the parquet extension). It should be in build/extension/parquet/../parquet_extension.lib.

Also, as a request I did earlier, can you ship the above mentioned files in your release versions so that we dont have to compile the project across various platforms.

This is an outstanding issue (#1124). We will make this happen when we get to it, but it is not an immediate priority.

I see that you have merged the patch. So also pulled the fresh code from the repo and tried that. But I still am unable to generate the extension

Perhaps refresh your CMake cache and do a clean rebuild, for me the extension pops up in duckdb\build\extension\parquet\Debug\parquet_extension.lib after building.

Thank you so much. All the issues are resolved now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mytherin picture Mytherin  路  5Comments

wizzard0 picture wizzard0  路  6Comments

Mytherin picture Mytherin  路  8Comments

Mytherin picture Mytherin  路  5Comments

x2bool picture x2bool  路  3Comments