Open jeeftor opened 4 years ago
Switched to Visual Studio 2017 and it worked:
Open power shell (admin mode)
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install https://chocolatey.org/packages/VisualStudio2017Community
Then open a dev terminal:
cd \
#git clone https://github.com/Microsoft/vcpkg.git
git config --global http.sslVerify false
git clone https://github.com/mfontanini/cppkafka.git
cd cppkafka
curl -sq -k -o nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
mkdir build
nuget install boost -Version 1.72.0 -OutputDirectory build/packages
nuget install librdkafka.redist -Version 1.5.0 -OutputDirectory build/packages
cd build
cmake .. -DBoost_DEBUG=OFF -DBOOST_ROOT=C:\cppkafka\build\packages\boost.1.72.0.0 -DBoost_NO_SYSTEM_PATHS=ON -DBOOST_INCLUDEDIR=C:\cppkafka\build\packages\boost.1.72.0.0\lib\native\include -DCPPKAFKA_CMAKE_VERBOSE=OFF -DRdKafka_INCLUDE_DIR=C:\cppkafka\build\packages\librdkafka.redist.1.5.0\build\native\include -DRdKafka_LIBRARY_PATH=C:\cppkafka\build\packages\librdkafka.redist.1.5.0\runtimes\win-x64\native
start CppKafka.sln
I found an issue when using the Win64 generator:
git config --global http.sslVerify false
git clone https://github.com/mfontanini/cppkafka.git
cd cppkafka
curl -sq -k -o nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
mkdir build
nuget install boost -Version 1.72.0 -OutputDirectory build/packages
nuget install librdkafka.redist -Version 1.5.0 -OutputDirectory build/packages
cd build
cmake .. -DBoost_DEBUG=OFF -DBOOST_ROOT=C:\cppkafka\build\packages\boost.1.72.0.0 -DBoost_NO_SYSTEM_PATHS=ON -DBOOST_INCLUDEDIR=C:\cppkafka\build\packages\boost.1.72.0.0\lib\native\include -DCPPKAFKA_CMAKE_VERBOSE=OFF -DRdKafka_INCLUDE_DIR=C:\cppkafka\build\packages\librdkafka.redist.1.5.0\build\native\include -DRdKafka_LIBRARY_PATH=C:\cppkafka\build\packages\librdkafka.redist.1.5.0\runtimes\win-x64\native -G "Visual Studio 15 2017 Win64"
start CppKafka.sln
This version compiles with errors...
For me works if I add to cmake options:
-DCPPKAFKA_BUILD_SHARED=OFF
And I edit: C:\cppkafka\CMakeLists.txt
Adding this line:
add_definitions("-DNOMINMAX=1")
Could someone give me an explanation about this last?
I've been using the linux lib without issues and am trying to port my code over to windows:
I believe I'm following (inspired by) the wiki directions ... and I've done the following to checkout project and libs (if this works I'll make a PR to the repo)
This then fires off VisualStudio 2019 - and when I build I'm ending up with a bunch of errors:
So the first thing that jumps to mind is I'm pointing at a
.lib
file and its calling out:which makes me think I need to swap over to the
dll
? perhapsHowever some of the other errors are confusing.
Any help appreciated.
Thanks