- POCOExercise
- 1. Description
- 2. Example list
- 3. Setup Guide
- 4. Build, Debug, and Test
- 5. Integrated Development Environment (IDE) Support
- 6. License
This repository contains a C++
based project which have some example code of POCO.
Supports Linux
/macOS
/Windows
on x64
and arm64
platforms.
- Example 1: Simple TCP Server/Client
- Example 2: WebSocket Server/Client
If you are developing in Linux or macOS, skip to Section 3.2.
If you have already installed Visual Studio 2022, you can skip this part.
- Go to https://visualstudio.microsoft.com/downloads/
- In
All Downloads
, open upTools for Visual Studio
and downloadBuild Tools for Visual Studio 2022
- Install the downloaded file
- Execute
Developer PowerShell for Visual Studio 2022
- Go to the project directory (For example, run
cd "C:/REPO/POCOExercise"
) - Run
vscode .
Now you can build and run the project! Keep in mind you should always open the project like this way.
(If you clone this repository and open with plain VSCode, you will see following error after all:
[cmake] CMake Error: CMake was unable to find a build program corresponding to "Ninja Multi-Config". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
[cmake] CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
[cmake] CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Go to extensions tab and install following extensions:
- C/C++
- C/C++ Extension Pack
- CMake
- CMake Langugage Support
- CMake Tools
After you install the above extensions and select in the status bar the CMake preset (e.g. ninja-multi-vcpkg
), as show in the following image:
Before build or debug, click the following button to choose the target:
Then choose the target:
- Open the command palette(
ctrl+shift+p
) - Run
CMake: Build
to build all targets - Run
CMake: Build target
to build the target currently selected
- Open the command palette(
ctrl+shift+p
) - Run
CMake: Debug
- Open the command palette(
ctrl+shift+p
) - Run
CMake: Run Tests
The major C++
IDEs should already support CMakePresets.json
and require no particular configuration.
For example Visual Studio Code with the CMake Tools extension let you to open the root folder of this repository, and select in the status bar the CMake preset (e.g. ninja-multi-vcpkg
), as show in the following image:
All the content in this repository is licensed under the MIT License.
Copyright © 2024 Luca Cappa, Taein Kim