curl-ipify-example
An example how to use libcurl & nlohmann-json for ipify
Prerequisites
- CMake v3.2
- vcpkg for cpp package manager
- nlohmann-json library for parsing and dumping JSON data
- libcurl library for HTTP(s) request
Usage
# Clone the repository
git clone https://github.com/mansuf/curl-ipify-example.git
cd curl-ipify-example
# Install the required packages
vcpkg install nlohmann-json
vcpkg install curl
# Build the app
# Replace {PATH_TO_vcpkg} to your vcpkg cmake script
# Example: vcpkg root directory is stored in /etc/vcpkg, so the {PATH_TO_vcpkg}
# would be /etc/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake -DCMAKE_TOOLCHAIN_FILE:STRING={PATH_TO_vcpkg.cmake} -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S. -B./build
cmake --build "./build"
# Run the app
cd "./build/Release"
curl_ipify.exe