BewareMyPower opened a new issue, #97: URL: https://github.com/apache/pulsar-client-cpp/issues/97
### Search before asking - [X] I searched in the [issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing similar. ### Version See the compiler info from the CMake outputs: ``` -- Building for: Visual Studio 16 2019 -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044. -- The C compiler identification is MSVC 19.29.30146.0 -- The CXX compiler identification is MSVC 19.29.30146.0 ``` ### Minimal reproduce step There are some artifacts in my own fork that are built from the workflow added in #73. https://github.com/BewareMyPower/pulsar-client-cpp/releases/tag/v3.1.0-rc-20221028 Download the [x64-windows-static.zip](https://github.com/BewareMyPower/pulsar-client-cpp/releases/download/v3.1.0-rc-20221028/x64-windows-static.zip) and uncompress to a directory, e.g `D:\pulsar-cpp`. CMakeLists.txt: ```cmake cmake_minimum_required(VERSION 3.15) project(pulsar-cpp) set(CMAKE_PREFIX_PATH "D:\\pulsar-cpp") find_path(PULSAR_INCLUDE_DIR NAMES "pulsar/Client.h") find_library(PULSAR_LIBRARY NAMES "pulsarWithDeps.lib") message(STATUS "PULSAR_INCLUDE_DIR: " ${PULSAR_INCLUDE_DIR}) message(STATUS "PULSAR_LIBRARY: " ${PULSAR_LIBRARY}) add_executable(PulsarApp PulsarApp.cc) set_target_properties(PulsarApp PROPERTIES MSVC_RUNTIME_LIBRARY MultiThreaded) target_compile_options(PulsarApp PRIVATE "-DPULSAR_STATIC") target_include_directories(PulsarApp PRIVATE ${PULSAR_INCLUDE_DIR}) target_link_libraries(PulsarApp PRIVATE ${PULSAR_LIBRARY}) ``` PulsarApp.cc: ```c++ #include <pulsar/Client.h> int main() { pulsar::Client client("pulsar://localhost:6650"); client.close(); } ``` Run the following commands: ```bash cmake -B build cmake --build build --config Release ``` ### What did you expect to see? The build should succeed. ### What did you see instead? ``` pulsarWithDeps.lib(PatternMultiTopicsConsumerImpl.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1 [D :\VS2019\pulsar-cpp-demo\build\PulsarApp.vcxproj] pulsarWithDeps.lib(Url.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1 [D:\VS2019\pulsar-cpp-demo\bu ild\PulsarApp.vcxproj] pulsarWithDeps.lib(AuthOauth2.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1 [D:\VS2019\pulsar-cpp- demo\build\PulsarApp.vcxproj] pulsarWithDeps.lib(ZTSClient.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1 [D:\VS2019\pulsar-cpp-d emo\build\PulsarApp.vcxproj] pulsarWithDeps.lib(Schema.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1 [D:\VS2019\pulsar-cpp-demo \build\PulsarApp.vcxproj] pulsarWithDeps.lib(HTTPLookupService.obj) : error LNK2001: unresolved external symbol __std_find_trivial_1 [D:\VS2019\puls ar-cpp-demo\build\PulsarApp.vcxproj] pulsarWithDeps.lib(AuthOauth2.obj) : error LNK2019: unresolved external symbol __std_init_once_link_alternate_names_and_ab ort referenced in function "void __cdecl std::call_once<void (__cdecl pulsar::ClientCredentialFlow::*)(void),class pulsar: :ClientCredentialFlow *>(struct std::once_flag &,void (__cdecl pulsar::ClientCredentialFlow::*&&)(void),class pulsar::Clie ntCredentialFlow * &&)" (??$call_once@P8ClientCredentialFlow@pulsar@@EAAXXZPEAV12@@std@@YAXAEAUonce_flag@0@$$QEAP8ClientCr edentialFlow@pulsar@@EAAXXZ$$QEAPEAV23@@Z) [D:\VS2019\pulsar-cpp-demo\build\PulsarApp.vcxproj] pulsarWithDeps.lib(message_lite.cc.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_a nd_abort [D:\VS2019\pulsar-cpp-demo\build\PulsarApp.vcxproj] pulsarWithDeps.lib(arenastring.cc.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_an d_abort [D:\VS2019\pulsar-cpp-demo\build\PulsarApp.vcxproj] pulsarWithDeps.lib(crc32c_sw.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_and_abo rt [D:\VS2019\pulsar-cpp-demo\build\PulsarApp.vcxproj] D:\VS2019\pulsar-cpp-demo\build\Release\PulsarApp.exe : fatal error LNK1120: 2 unresolved externals [D:\VS2019\pulsar-cpp- demo\build\PulsarApp.vcxproj] ``` ### Anything else? The artifacts were built on Windows Server 2022. https://github.com/apache/pulsar-client-cpp/blob/74ebc10337e6b33b4427a6b126edc0b9f8424bb0/.github/workflows/ci-build-binary-artifacts.yaml#L96 From [here](https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md#microsoft-visual-c) we can see the version of MSVC 2022 runtime is 14.32.31332, which might be incompatible with MSVC 19.29 ### Are you willing to submit a PR? - [X] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
