Microsoft Visual Studio 2015 or newer is required tobuild the POCO C++ Libraries on Windows platforms.
Visual Studio 2019 Installation
To get Visual Studio 2019, you can download it from Visual Studio Downloads. Be sure to include the C++ development tools when you install Visual Studio, because they are not installed by default. For more information about how to install Visual Studio, see Install Visual Studio.
vcpkg is a command-line package manager for C++. It greatly simplifies the acquisition and installation of third-party libraries in our case the poco library.
You can download vcpkg repo from GitHub: https://github.com/Microsoft/vcpkg to any folder location you prefer.
To download and compile poco libraries , at the command prompt go to the folder where vcpkg was downloaded.
C:/Lenovo/user/> cd /path/to/vcpkgIn 32 bit machines, run the command
C:/path/to/vcpkg>
C:/path/to/vcpkg> vcpkg install poco:x86-windowsIn 64 bit machines, run the command
C:/path/to/vcpkg> vcpkg install poco:x64-windows
The following poco libraries require third-party
software (header files and
libraries) being installed to build properly:
- NetSSL_OpenSSL and Crypt require OpenSSL.
C:/path/to/vcpkg> vcpkg list
Run the below command to configure Visual Studio to locate all vcpkg header files and binaries on a per-user basis. There's no need for manual editing of VC++ Directories paths in visual studio project. All installed libraries are immediately ready to be used in your project without additional configuration.
C:/path/to/vcpkg> vcpkg integrate install
#include "Poco/Util/Units.h"
#include <iostream>
using namespace Poco::Util::Units::Values;
using namespace Poco::Util::Units::Constants;
int main()
{
std::cout << "One mile is " << km(mile(1)) << std::endl;
m l = cm(42);
std::cout << cm(42) << " == " << l << " == " << milli(l) << std::endl;
std::cout << "Area of circle with radius" << l <<" is " << m2(square(l) * pi) << std::endl;
return 0;
}
And verify the output.
OUTPUT
One mile is 1.60934 km
42 cm == 0.42 m == 420 mm
Area of
circle with radius 0.42 m is 0.554177 (m)^2
NOTE : For errors like 'cannot open source file' or 'cannot open header file', go to project properties->platform and change to x86 for 32bit machine and x64 for 64bit machine. This resolves the error (if the path is valid).
Name | Views | Likes |
---|---|---|
C++ POCO Foundation::Filesystem::Path | 720 | 0 |
C++ Poco::Foundation::Regex | 605 | 0 |
C++ POCO Foundation::DateTime::Clock | 330 | 0 |
C++ POCO windows installation | 2570 | 0 |
Comments