Skip to content

JeffMill/poco-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poco apps using VCPKG

WSL Note: WSL maps Windows drives. ~/Downloads becomes /mnt/c/Users/jeffmill/Downloads

Windows Instructions

Install Visual Studio Build Tools (includes cmake)

Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vs_BuildTools.exe' -OutFile "$env:TEMP/vs_BuildTools.exe"

& "$env:TEMP/vs_BuildTools.exe" --passive --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended

Add CMAKE to path

$env:PATH += ";${Env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"

Install vcpkg

winget install 'Git.git'

cd \

git clone https://github.com/microsoft/vcpkg

.\vcpkg\bootstrap-vcpkg.bat

Build

Generate makefiles

cmake.exe -B build -S . -D CMAKE_TOOLCHAIN_FILE='/vcpkg/scripts/buildsystems/vcpkg.cmake'

Build App

Note: You can also specify Release or RelWithDebInfo instead of Debug.

cmake.exe --build build --parallel --config Debug

Run

./build/Debug/sha256sum.exe

Debug

winget install 'WinDbg Preview'

windbgx.exe -y '\vcpkg\packages\poco_x64-windows\debug\bin' -c 'bp sha256sum!Application::main; g' -xe eh .\build\Debug\sha256sum.exe *

Linux Instructions

Install build-essential cmake

sudo apt update --yes && sudo apt upgrade --yes

sudo apt-get install build-essential cmake --yes

Install vcpkg

sudo apt-get install curl zip unzip tar pkg-config --yes

git clone https://github.com/Microsoft/vcpkg.git ~/vcpkg

~/vcpkg/bootstrap-vcpkg.sh

Build

Generate makefiles

cmake -B build -S . -D CMAKE_TOOLCHAIN_FILE='~/vcpkg/scripts/buildsystems/vcpkg.cmake'

Build App

Note: You can also specify Release or RelWithDebInfo instead of Debug.

cmake --build build --parallel --config Debug

If building with Release, use strip build/sha256sum afterwards to strip binary of symbols. Unclear why this is needed for Release build.

Run

# For sha256sum test app
mkdir ~/.local/tmp

chmod u+x build/sha256sum

build/sha256sum

Debug

Use gdb. catch throw might catch C++ exceptions at source.

References

POCO docs

POCO Reference

POCO Presentation

namespace Net

POCO samples

POCO includes samples as well. Enlist in the POCO repo:

git clone https://github.com/pocoproject/poco.git

then search for the projects:

Get-ChildItem -Recurse -Directory | Select-Object FullName | Where-Object FullName -like '*\samples\*\src'

VCPKG Manifest Mode

Manifest Mode

vcpkg.json Reference

Manifest mode: CMake example

About

C++ POCO apps using VCPKG

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published