Introduce two compilation methods, xmake and vcpkg
Open powershell
Download paozhu
https://github.com/hggq/paozhu
Extract to current directory paozhu
Install Visual Studio Community
https://visualstudio.microsoft.com/vs/compare/
Choose desktop development mode
https://dev.mysql.com/downloads/mysql/
MySQL Community Server 8
Open MySQL 8.4 command line client (open search input mysql find this tools)
#[Option]mysql -u root -p
create database cppcms default character set utf8mb4 collate utf8mb4_general_ci;
use cppcms;
source C:\Users\a\paozhu\conf\cppcms.sql;
use mysql;
create user 'cppcms'@'localhost' identified by 'H3fHeRlVbwU@4456';
GRANT ALL PRIVILEGES ON cppcms.* TO 'cppcms'@'localhost';
[May be in TEST ENV] ALTER USER 'cppcms'@'localhost' identified by '12345678';
select host,user,authentication_string from user;
exit;
Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content
Config conf/server.conf
replace /Users/hzq/paozhu path to your project path
paozhu-main> unzip asio.zip
paozhu-main> xmake
paozhu-main> .\build\windows\x64\release\paozhu.exe
copy
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\clang_rt.asan_dynamic-x86_64.dll
to
bin\Debug\clang_rt.asan_dynamic-x86_64.dll
paozhu-main> .\build\windows\x64\release\paozhu.exe
Open Browser
http://localhost
http port see conf/server.conf
file
Install CMake https://cmake.org/download/
Download the last package https://github.com/microsoft/vcpkg/releases
unzip vcpkg2024.zip
mv vcpkg-2024.09.30 vcpkg
cd vcpkg
bootstrap-vcpkg.bat
.\vcpkg.exe integrate install
.\vcpkg.exe integrate project
[Maybe pre download packages to downloads directory]
.\vcpkg.exe install zlib
.\vcpkg.exe install openssl
.\vcpkg.exe install brotli
.\vcpkg.exe install asio
OR NOT ninja
Notice: Replace C:/Users/a/vcpkg to your vcpkg directory
cmake . -B . -DENABLE_WIN_VCPKG=ON -DENABLE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE=C:/Users/a/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug
cmake --build . --config Debug
copy
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\clang_rt.asan_dynamic-x86_64.dll
to
bin\Debug\clang_rt.asan_dynamic-x86_64.dll
PS C:\Users\a\paozhu> C:\Users\a\paozhu\bin\Debug\paozhu.exe
Install ninja https://github.com/ninja-build/ninja/releases
Compile project CMAKE_TOOLCHAIN_FILE is vcpkg install localtion path
unzip asio.zip
cmake . -B . -DENABLE_WIN_VCPKG=ON -DENABLE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug -G Ninja
cmake --build . --config Debug
Open Browser
http://localhost
http port see conf/server.conf
file