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 2021/04/25 11:27:47 UTC

[GitHub] [pulsar] BewareMyPower opened a new pull request #10363: Fix C++ client cannot be built on Windows

BewareMyPower opened a new pull request #10363:
URL: https://github.com/apache/pulsar/pull/10363


   ### Motivation
   
   C++ source code cannot be built on Windows. The build commands are:
   
   ```powershell
   > cmake -B _builds -S . `
     -DBUILD_PYTHON_WRAPPER=OFF -DBUILD_TESTS=OFF
   > cmake --build .\_builds\
   ```
   
   There're two errors. One is
   
   > pulsar-client-cpp\lib\ReaderImpl.h(34): error C2144: syntax error: 'int' should be preceded by ';'
   > ...
   
   It's because `PULSAR_PUBLIC` is `__declspec(dllexport)` on Windows platform and it should be put before the variable type.
   
   The other error is
   
   > LINK : fatal error LNK1104: cannot open file 'pulsar.lib' pulsar\pulsar-client-cpp\_builds
   \examples\SampleReaderCApi.vcxproj]
   > ...
   
   It looks like when files under `examples` and `perf` directories were compiled, it tried to link `pulsar.lib` and CMake target `pulsarShared`'s name has a `dll` suffix, like `pulsardll.lib` and `pulsardll.dll`. The suffix is redundant.
   
   ### Modifications
   
   - Put `PULSAR_PUBLIC` before the variable type.
   - Keep the `LIB_NAME` as the shared library's name, i.e. remove the `dll` suffix.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change is a trivial rework / code cleanup without any test coverage.


-- 
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.

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



[GitHub] [pulsar] lhotari commented on pull request #10363: Fix C++ client cannot be built on Windows

Posted by GitBox <gi...@apache.org>.
lhotari commented on pull request #10363:
URL: https://github.com/apache/pulsar/pull/10363#issuecomment-826350061


   /pulsarbot run-failure-checks


-- 
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.

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



[GitHub] [pulsar] codelipenghui merged pull request #10363: Fix C++ client cannot be built on Windows

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #10363:
URL: https://github.com/apache/pulsar/pull/10363


   


-- 
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.

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



[GitHub] [pulsar] BewareMyPower commented on pull request #10363: Fix C++ client cannot be built on Windows

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #10363:
URL: https://github.com/apache/pulsar/pull/10363#issuecomment-826308760






-- 
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.

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



[GitHub] [pulsar] lhotari commented on pull request #10363: Fix C++ client cannot be built on Windows

Posted by GitBox <gi...@apache.org>.
lhotari commented on pull request #10363:
URL: https://github.com/apache/pulsar/pull/10363#issuecomment-826350061


   /pulsarbot run-failure-checks


-- 
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.

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



[GitHub] [pulsar] codelipenghui merged pull request #10363: Fix C++ client cannot be built on Windows

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #10363:
URL: https://github.com/apache/pulsar/pull/10363


   


-- 
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.

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



[GitHub] [pulsar] BewareMyPower commented on pull request #10363: Fix C++ client cannot be built on Windows

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #10363:
URL: https://github.com/apache/pulsar/pull/10363#issuecomment-826309581


   I think we can release the C++ client to some existed package manager. I see https://github.com/edenhill/librdkafka uses NuGet for package management. Also I think https://github.com/microsoft/vcpkg is good.


-- 
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.

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



[GitHub] [pulsar] BewareMyPower commented on pull request #10363: Fix C++ client cannot be built on Windows

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #10363:
URL: https://github.com/apache/pulsar/pull/10363#issuecomment-826308760


   Currently there's no CI build process for Windows. It's different from Unix systems that could install a compiler easily. Also I'm not familiar with how to install the necessary softwares using pure commands on Windows.
   
   I built Pulsar C++ client on Windows with CMake 3.20 and Visual Studio 2019 Community, though I didn't use the IDE directly but only use CMake to detect the Windows C++ compiler behind the IDE.


-- 
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.

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