SQLiteCpp icon indicating copy to clipboard operation
SQLiteCpp copied to clipboard

LNK2001: unresolved external symbol "SQLite::OPEN_READONLY"

Open index1207 opened this issue 1 year ago • 3 comments

Environmnet

  • package manager: vcpkg
  • version: 3.3.1
  • compiler: Visual Studio 2022

Reproduce problem

  • In vs2022 project, enable use vcpkg option
  • Add dependency splitecpp
  • Compile by debug mode

index1207 avatar Jul 12 '24 00:07 index1207

my code:

#include <memory>
#include "SQLiteCpp/SQLiteCpp.h"

int main() {
  auto m_datasheet = std::make_unique<SQLite::Database>("Common/Database/datasheet.db");
  ...
}

index1207 avatar Jul 12 '24 00:07 index1207

I solved it by defining SQLITECPP_COMPILE_DLL, but I think README.md needs explanation.

index1207 avatar Jul 12 '24 05:07 index1207

seems an error related to #432 this issue is only specific to vcpkg as cmake is working as expected, still I think it should be a good idea to put it in the readme so any vcpkg user is aware of it, feel free to open a PR

UnixY2K avatar Jul 23 '24 22:07 UnixY2K