Open serg06 opened 4 years ago
Hi @serg06
I am sorry for not updating the Wiki after 2.x.x release.
For building EasyHttp 2.x.x on Windows, here are the steps (will update Wiki once this issue is fixed):
When installing Poco, please make sure to use the following settings (especially note this part -DENABLE_NET=ON -DENABLE_NETSSL=OFF -DENABLE_NETSSL_WIN=ON -DENABLE_CRYPTO=OFF
)
Please change %PATH_TO_INSTALL_FOLDER%
C:\> cmake -G "Visual Studio %CMAKE_VS_VERSION%" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DPOCO_VERBOSE_MESSAGES=OFF -DPOCO_STATIC=ON -DPOCO_UNBUNDLED=OFF -DENABLE_XML=ON -DENABLE_JSON=ON -DENABLE_UTIL=ON -DENABLE_NET=ON -DENABLE_NETSSL=OFF -DENABLE_NETSSL_WIN=ON -DENABLE_CRYPTO=OFF -DENABLE_DATA=ON -DENABLE_DATA_SQLITE=ON -DENABLE_ZIP=OFF -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_ODBC=OFF -DENABLE_MONGODB=OFF -DENABLE_PDF=OFF -DENABLE_SEVENZIP=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=OFF -DENABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX="%PATH_TO_INSTALL_FOLDER%" ../
C:\> "C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe" Poco.sln
C:\> "C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe" INSTALL.vcxproj
%PATH_TO_INSTALL_FOLDER%
C:\> cmake -G "Visual Studio %CMAKE_VS_VERSION%" -DCMAKE_BUILD_TYPE=Release -DEASYHTTPCPP_VERBOSE_MESSAGES=ON -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_PREFIX_PATH="%PATH_TO_INSTALL_FOLDER%" -DENABLE_TESTS=ON -DCMAKE_INSTALL_PREFIX="%PATH_TO_INSTALL_FOLDER%" ../
C:\> "C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe" easyhttpcpp.sln
C:\> "C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe" INSTALL.vcxproj
Let me know if this works.
Hi @shekharhimanshu, thanks for the reply.
I tried building Poco 1.7.9 and EasyHttpCpp 2.1.0 with those commands. All the Poco steps worked perfectly, but the EasyHttpCpp cmake step failed.
Here's the command, with %PATH_TO_INSTALL_FOLDER%
replaced with the same value as I used in the Poco cmake command:
cmake -DCMAKE_BUILD_TYPE=Release -DEASYHTTPCPP_VERBOSE_MESSAGES=ON -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_PREFIX_PATH="C:/lib/easyhttpcpp" -DENABLE_TESTS=ON -DCMAKE_INSTALL_PREFIX="C:/lib/easyhttpcpp" ../
And the error:
-- Building static easyhttpcpp libraries
CMake Error at tests/CMakeLists.txt:7 (find_package):
Could not find a package configuration file provided by "GMock" with any of
the following names:
GMockConfig.cmake
gmock-config.cmake
Add the installation prefix of "GMock" to CMAKE_PREFIX_PATH or set
"GMock_DIR" to a directory containing one of the above files. If "GMock"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
My bad. Sorry about that.
We need googletest
for testing purposes.
In step 2, kindly turn off tests, -DENABLE_TESTS=ON
-> -DENABLE_TESTS=OFF
.
%PATH_TO_INSTALL_FOLDER%
C:\> cmake -G "Visual Studio %CMAKE_VS_VERSION%" -DCMAKE_BUILD_TYPE=Release -DEASYHTTPCPP_VERBOSE_MESSAGES=ON -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_PREFIX_PATH="%PATH_TO_INSTALL_FOLDER%" -DENABLE_TESTS=OFF -DCMAKE_INSTALL_PREFIX="%PATH_TO_INSTALL_FOLDER%" ../
C:\> "C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe" easyhttpcpp.sln
C:\> "C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe" INSTALL.vcxproj
If you wish to build EasyHttp tests as well, please install GoogleTest as well. Let me know if this works.
Brief overview
I tried to build EasyHttp on Windows using the wiki guide. It worked for EasyHttp 1.0.0, but not for 2.0.0 or 2.1.0.
First I was getting this error:
I fixed it by changing my Poco CMake command to this:
But now I have a new issue when I try to build:
What am I doing wrong?
Steps to reproduce
Get a Windows 10 x64 machine.
Install OpenSSL 1.1.1e from Shining Light Productions.
Check out release 2.1.0.
Follow wiki guide.
(Optional) Get rid of first error by replacing poco cmake command with
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_NETSSL_WIN=ON ../
.Specifications like the version of the project, operating system, or hardware etc.
EasyHttp Release 2.1.0.
Poco 1.7.9.
Windows 10 x64 on a Dell G3 laptop.