You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, the constructor for Database that takes a std::filesystem::path argument is not found by the linker. It does not appear to be present in the vcpkg\installed\x64-windows\lib\SQLiteCpp.lib (DUMPBIN output provided below).
I tried running this on a Linux machine and it successfully built and ran so it must have something to do with Windows builds specifically.
I tested passing a std::string instead of a std::filesystem::path and that built and ran successfully on Windows 11.
this is an vcpkg specific issue(see #432#431)
as a workarround you can manually define SQLITECPP_COMPILE_DLL in your project definition or via source code like this
#defineSQLITECPP_COMPILE_DLL
#include<SQLiteCpp/SQLiteCpp.h>// rest of your code
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"OPTIONS${FEATURE_OPTIONS}
-DSQLITECPP_RUN_CPPLINT=OFF
-DSQLITECPP_RUN_CPPCHECK=OFF
-DSQLITECPP_INTERNAL_SQLITE=OFF
-DSQLITE_ENABLE_COLUMN_METADATA=ON
-DSQLITECPP_USE_STATIC_RUNTIME=OFF# unconditionally off because vcpkg's toolchains already do the right thing# See https://github.com/SRombauts/SQLiteCpp/blob/e74403264ec7093060f4ed0e84bc9208997c8344/CMakeLists.txt#L40-L46${USE_STACK_PROTECTION}
)
this section should define: BUILD_SHARED_LIBS depending on the option
Adding SQLITECPP_COMPILE_DLL does not fix this issue. As @masonhieb explained, SQLiteCpp was compiled without that overload for SQLite::Database constructor.
Preface
I installed
SQLiteCpp
3.3.1
usingvcpkg
Description
On Windows, the constructor for
Database
that takes astd::filesystem::path
argument is not found by the linker. It does not appear to be present in thevcpkg\installed\x64-windows\lib\SQLiteCpp.lib
(DUMPBIN
output provided below).I tried running this on a Linux machine and it successfully built and ran so it must have something to do with Windows builds specifically.
I tested passing a
std::string
instead of astd::filesystem::path
and that built and ran successfully on Windows 11.Minimal Reproducible Example
main.cpp
CMakeLists.txt
Output
Relevant Output of
DUMPBIN /EXPORTS SQLiteCpp.lib
Windows Build Output
The text was updated successfully, but these errors were encountered: