kRPC: Control the game using C#, C++, Java, Lua, Python...

kRPC: Control the game using C#, C++, Java, Lua, Python...

7.8k Downloads

Symbols not exported when krpc library is compiled in Visual Studio

nullprofile opened this issue ยท 1 comments

commented

Compiling the C++ client library with Visual Studio 2017 results in no .lib being generated.
Adding set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) after line 29 in CMakeLists.txt fixes this. Requires CMake 3.4 or newer.

if(MSVC)
# protobuf statically links against MT, so need to compile with /MT not /MD
foreach(var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
endif()
endforeach()
endif()

commented

Thanks for reporting!