mfontanini / cppkafka

Modern C++ Apache Kafka client library (wrapper for librdkafka)
BSD 2-Clause "Simplified" License
589 stars 207 forks source link

Error building on Windows (again) #255

Open PversusNP opened 4 years ago

PversusNP commented 4 years ago

I read the closed thread: https://github.com/mfontanini/cppkafka/issues/10 but I can't understand if last version available is fixed.

I followed: https://github.com/mfontanini/cppkafka/issues/2 to build dynamic library on Win32 platform for VS2015 but it doesn't work. I must rely on librdkafka's source built with cmake ot on nuget package?

I tried the second, setting manually Boost_INCLUDE_DIR, RdKafka_INCLUDE_DIR, RdKafka_LIBRARY_PATH because -D parameters and find_package fail. I also needed to disable TESTS and EXAMPLES. CMake configuration at the end succeded, but the generated solution doesn't compile. What's wrong?

jeeftor commented 4 years ago

I did the following (still erroring on build currently)

ggit 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\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=ON -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\build\native\lib\win\x64\win-x64-Release\v120
start CppKafka.sln

See if that gets you any further