Question

In order to test leveldb, I tried to reproduce the leveldb's example on VS 2008.

#include <assert.h>
#include "leveldb/db.h"

int main()
{
    leveldb::DB* db;
    leveldb::Options options;
    options.create_if_missing = true;
    leveldb::Status status = leveldb::DB::Open(options,"D:\dev\tools\tmp",&db);
}

I have included leveldb/include directory and linked libleveldb.lib.

Result :

error LNK2019: unresolved external symbol "public: static class leveldb::Status __cdecl leveldb::DB::Open(struct leveldb::Options const &,class std::basic_string,class std::allocator > const &,class leveldb::DB * *)" (?Open@DB@leveldb@@SA?AVStatus@2@ABUOptions@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAPAV12@@Z) referenced in function _main

error LNK2019: unresolved external symbol public: __thiscall leveldb::Options::Options(void)" (??0Options@leveldb@@QAE@XZ) referenced in function _main

Does anyone know how to fix this ?

Was it helpful?

Solution

Solution :

Use levelDb-portable from zhangyafreikimi

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top