You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/31 09:43:46 UTC

[GitHub] [pulsar-client-cpp] BewareMyPower opened a new issue, #97: [Bug] The Windows artifacts build from GA is incompatible with MSVC 19.29

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: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-cpp] BewareMyPower commented on issue #97: [Bug] The Windows artifacts build from GA is incompatible with MSVC 19.29

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on issue #97:
URL: https://github.com/apache/pulsar-client-cpp/issues/97#issuecomment-1296869880

   https://learn.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=msvc-160
   
   >  Say you have third-party libraries built by Visual Studio 2015. You can still use them in an application built by Visual Studio 2017, 2019, or 2022. There's no need to recompile with a matching toolset. The latest version of the Microsoft Visual C++ Redistributable package (the Redistributable) works for all of them.
   
   I think the binaries built by VS 2019 should be compatible with VS 2022. So it might be better to use `windows-2019` in the workflow instead of `windows-latest`.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-cpp] BewareMyPower closed issue #97: [Bug] The Windows artifacts build from GA is incompatible with MSVC 19.29

Posted by GitBox <gi...@apache.org>.
BewareMyPower closed issue #97: [Bug] The Windows artifacts build from GA is incompatible with MSVC 19.29
URL: https://github.com/apache/pulsar-client-cpp/issues/97


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org