Hi guys. I'm trying to compile a C++ lib to link w...
# kotlin-native
s
Hi guys. I'm trying to compile a C++ lib to link with K/N C-interop. So far, I've got it working on linux, android, mac, ios, tvos, etc. Only Windows is eluding me. Here is a sample compilation line:
Copy code
C:\Users\timel\.konan\dependencies\msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1\bin\clang++.exe --sysroot=C:/Users/timel/.konan/dependencies/msys2-mingw-w64-x86_64-clang-llvm-lld-compiler_rt-8.0.1  -DLEVELDB_COMPILE_LIBRARY -DLEVELDB_PLATFORM_WINDOWS=1 -DUNICODE -D_UNICODE @CMakeFiles/leveldb.dir/includes_CXX.rsp -D_GLIBCXX_USE_CXX11_ABI=0 -IC:\Users\timel\IdeaProjects\Kodein-DB\ldb\lib\build/out/konan/include -femulated-tls -O3 -DNDEBUG   -Werror -Wthread-safety -std=c++11 -o CMakeFiles\leveldb.dir\util\env_<http://windows.cc|windows.cc>.obj -c C:\Users\timel\IdeaProjects\Kodein-DB\ldb\lib\src\leveldb\util\env_<http://windows.cc|windows.cc>
As you can see, I am compiling the library with K/N clang, with K/N sysroot, and with
-femulated-tls
. So far, the library compiles and I get a static lib. Then, when konanc tries to link the C-interop bits with the static lib I've just compiled, I get this error: