facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
28.61k stars 6.32k forks source link

mingw64 rocksdb link issue #4825

Open leejw51 opened 5 years ago

leejw51 commented 5 years ago

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://www.facebook.com/groups/rocksdb.dev

Expected behavior

I am using mingw64 on windows

Actual behavior

I installed by "pacman -S rocksdb" by somehow g++ a.c -lrocksdb

C:\msys64\tmp\cc1MC5r2.o:a.c:(.text+0xc7): undefined reference to rocksdb::DBOptions::IncreaseParallelism(int)' C:\msys64\tmp\cc1MC5r2.o:a.c:(.text+0xde): undefined reference torocksdb::ColumnFamilyOptions::OptimizeLevelStyleCompaction(unsigned long long)' C:\msys64\tmp\cc1MC5r2.o:a.c:(.text+0x103): undefined reference to rocksdb::DB::Open(rocksdb::Options const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rocksdb::DB**)' C:\msys64\tmp\cc1MC5r2.o:a.c:(.text$_ZN7rocksdb7OptionsC1Ev[_ZN7rocksdb7OptionsC1Ev]+0x1a): undefined reference torocksdb::DBOptions::DBOptions()' C:\msys64\tmp\cc1MC5r2.o:a.c:(.text$_ZN7rocksdb7OptionsC1Ev[_ZN7rocksdb7OptionsC1Ev]+0x2c): undefined reference to `rocksdb::ColumnFamilyOptions::ColumnFamilyOptions()'

Steps to reproduce the behavior

here is a.c a.c)

include

include

include "rocksdb/db.h"

include "rocksdb/slice.h"

include "rocksdb/options.h"

using namespace rocksdb;

std::string kDBPath = "/tmp/rocksdb_simple_example";

int main() { DB* db; Options options; // Optimize RocksDB. This is the easiest way to get RocksDB to perform well options.IncreaseParallelism(); options.OptimizeLevelStyleCompaction(); // create the DB if it's not already present options.create_if_missing = true;

// open DB Status s = DB::Open(options, kDBPath, &db); assert(s.ok());

return 0; }

leejw51 commented 5 years ago

I'm struggling with this issuse for a week. any ideas? maybe librocksdb is broken?

siying commented 5 years ago

I'm not aware of anyone active in issues who is using MingW. I suggest you try https://www.prod.facebook.com/groups/rocksdb.dev/ where there might be wider audience.

siying commented 5 years ago

Or maybe @adamretter has any experience on this?

adamretter commented 5 years ago

@siying I am afraid that I have no experience with MingW.

I did read that the CockroachDB team are using MSYS2 instead of MingW as they understood that MingW is now defunct - search in this page for mingw - https://www.cockroachlabs.com/blog/windows-binary/