Closed rafalsk closed 9 months ago
@rafalsk the VCPKG is presumably provided by a third-party? We need to rule that out as that is not something we support directly. So... Do you see the same problems if you build your own lib from source?
Closing due to a lack of response.
Platform: Windows 11 Build Tools: Visual Studio 2022 + VCPKG (no modes default attempt to install rocksdb lib). Expected Behavior: the library loads Situation: a right-away crash, before control is passed over to main(). Cause: an attempt to dereference a NULLPTR during library loading stage.
We've been using RocksDB for years, building from source on Windows through Visual Studio and stuff.
Today, I felt lazy and thought to myself, hey, there's VCPKG right..haven't updated RocksDB for like a year or so..
After getting my VCPKG to work with Visual Studio 2022 which was sort of an unexpected pain in the ass, building RocksDB was a walk in the park (of course).
I was handed with debug and release builds almost right away. Great right?
So I deleted all the internal RocksDB-related headers, copied over the VCPKG-baked static lib and... crash. Tried both debug and release mode. Here's the call stack:
It crashed at the library loading stage, control is not even passed to my main() yet.
right over here
}
above 'c' is nullptr.
Ideas?`
Update: In order to isolate the issue, I've created a fresh new C++ Hello World project and linked the produced static lib.
I get unresolved externals as follows:
LNK2019 unresolved external symbol __imp_RpcStringFreeA referenced in function "bool __cdecl rocksdb::port::GenerateRfcUuid(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?GenerateRfcUuid@port@rocksdb@@YA_NPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) ConsoleApplication1 C:\Users\Dell\source\repos\ConsoleApplication1\ConsoleApplication1\rocksdbd.lib(port_win.cc.obj) 1 Error LNK2019 unresolved external symbol __imp_UuidCreateSequential referenced in function "bool __cdecl rocksdb::port::GenerateRfcUuid(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?GenerateRfcUuid@port@rocksdb@@YA_NPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) ConsoleApplication1 C:\Users\Dell\source\repos\ConsoleApplication1\ConsoleApplication1\rocksdbd.lib(port_win.cc.obj) 1 Error LNK2019 unresolved external symbol __imp_UuidToStringA referenced in function "bool __cdecl rocksdb::port::GenerateRfcUuid(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?GenerateRfcUuid@port@rocksdb@@YA_NPEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) ConsoleApplication1 C:\Users\Dell\source\repos\ConsoleApplication1\ConsoleApplication1\rocksdbd.lib(port_win.cc.obj) 1 Error LNK2019 unresolved external symbol __imp_PathIsDirectoryA referenced in function "public: virtual class rocksdb::IOStatus __cdecl rocksdb::port::WinFileSystem::IsDirectory(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct rocksdb::IOOptions const &,bool *,struct rocksdb::IODebugContext *)" (?IsDirectory@WinFileSystem@port@rocksdb@@UEAA?AVIOStatus@3@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBUIOOptions@3@PEA_NPEAUIODebugContext@3@@Z) ConsoleApplication1 C:\Users\Dell\source\repos\ConsoleApplication1\ConsoleApplication1\rocksdbd.lib(env_win.cc.obj) 1 Error LNK2019 unresolved external symbol __imp_PathIsRelativeA referenced in function "public: static unsigned __int64 __cdecl rocksdb::port::WinFileSystem::GetSectorSize(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?GetSectorSize@WinFileSystem@port@rocksdb@@SA_KAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) ConsoleApplication1 C:\Users\Dell\source\repos\ConsoleApplication1\ConsoleApplication1\rocksdbd.lib(env_win.cc.obj) 1