Skip to content

Symbols not exported when krpc library is compiled in Visual Studio #474

@nullprofile

Description

@nullprofile

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()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions