Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
WITH_STATIC_LIBRARIES does not work on Windows using CMAKE #1369
i tried the recent v1.6.4 to compile with WITH_STATIC_LIBRARIES=ON using CMake and VisualStudio 2017. The problem seems to be that some of the projects accidentially use the dll-version of the lib although expecting the static version (or maybe vice versa...) . The problem is there since at least 1.6.2 but propably older....
the static lib is build, but 5 projects (mosquitto_pub/sub,mosquitto_rr,...) fail to link, some of the linker errors from my cmake / vs2017 build log:
pub_client.obj : error LNK2019: unresolved external symbol __imp_mosquitto_lib_version referenced in function print_usage [C:\dev\tmp\cmake\mosquitto\VS2017_64\client\mosquitto_pub.vcxproj]
...\client_props.c(176): warning C4267: 'function': conversion from 'size_t' to 'uint16_t', possible loss of data [C:\dev\tmp\cmake\mosquitto\VS2017_64\client\mosquitto_rr.vcxproj]
sub_client.obj : error LNK2019: unresolved external symbol __imp_mosquitto_lib_version referenced in function print_usage [C:\dev\tmp\cmake\mosquitto\VS2017_64\client\mosquitto_sub.vcxproj]
btw,. WITH_STATIC_LIBRARIES=OFF compiles without problems in Release,Debug,64,32 bit...!