0% found this document useful (0 votes)
9 views14 pages

CD Setup Cpp Xpx Storage User App on Windows 130724 125735

This document provides detailed instructions for setting up the cpp-xpx-storage-user-app on a clean Windows installation, including system specifications and software requirements. It outlines the steps for downloading and installing Visual Studio, CLion, Qt Creator, Boost, and OpenSSL, as well as configuring the necessary environment variables and IDE settings to enable C++20 support. Additionally, it includes guidance on cloning the repository and configuring CMake settings for successful deployment of the application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views14 pages

CD Setup Cpp Xpx Storage User App on Windows 130724 125735

This document provides detailed instructions for setting up the cpp-xpx-storage-user-app on a clean Windows installation, including system specifications and software requirements. It outlines the steps for downloading and installing Visual Studio, CLion, Qt Creator, Boost, and OpenSSL, as well as configuring the necessary environment variables and IDE settings to enable C++20 support. Additionally, it includes guidance on cloning the repository and configuring CMake settings for successful deployment of the application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Setup cpp-xpx-storage-user-app on Windows

The following instructions are based on the experience with a clean Windows installation. Laptop specifications:

Processor Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 2.59 GHz


Installed RAM 64,0 GB (63,9 GB usable)
System type 64-bit operating system, x64-based processor
Edition Windows 11 Pro
Version 23H2
Installed on ‎03.‎06.‎2024
OS build 22631.3737
Experience Windows Feature Experience Pack 1000.22700.1009.0

1. Download the latest version of Visual Studio Community.

Скачать Инструменты Visual Studio — установить бесплатно для Windows, Mac, Linux

When installing, check Desktop development with C++.

Pay attention to the version of the MSVC compiler you are installing: you will need it later for choosing Boost prebuilt binaries:

Here we install MSVC version 14.3 .

2. Download and install CLion.

Download CLion: A Smart Cross-Platform IDE for C and C++


While installing, make sure the installer creates a User environment variable:

3. Download and install Qt Creator Community.

Open Source Development | Open Source License | Qt

Choose Qt Online Installer:

Install to C:\Qt . When installing, choose all components in Qt 6.x.x and in Additional Libraries:
4. Set your preferred IDE to enable C++20 support. Make sure that you can run C++20 code. Try running some sample code and see
whether it can successfully run and produces correct output. You can try this sample code:

1 #include <iostream>
2 int main()
3 {
4 auto result = (10 <=> 20) > 0;
5 std::cout << "result: " << result << std::endl;
6 }

The correct output should be: result: 0

5. Install Boost. It is advised that you use prebuilt Windows binaries instead of building your own Boost:

Boost C++ Libraries - Browse /boost-binaries at SourceForge.net

Download ...-64.exe version, like boost_1_85_0-msvc-14.3-64.exe , with the latest MSVC compiler version. Install Boost in
C:\boost_1_xx_x\ . It will look like this:
The highlighted folder lib64-msvc-14.3 should contain compiled .dlls :

Set 2 environment variables: in Search type ‘Edit the system environment variables’.
Add 2 system variables:

BOOST_INCLUDEDIR C:\boost_1_85_0

BOOST_ROOT C:\boost_1_85_0

6. Install OpenSSL. You can clone a repository and build on your own:

openssl/openssl

But it is advised that you use an installer:

OpenSSL 3.3, 3.0 LTS, 1.1.1 LTS Binaries for Microsoft Windows
Install OpenSSL in C:\OpenSSL . It will look like this:

After the installation make sure your PATH environment variable (system-wide) is updated:

PATH C:\OpenSSL\bin\

7. Clone the repository. Make sure you clone submodules:

https://github.com/proximax-storage/cpp-xpx-storage-user-app RESTRICTED CONTENT

1 git clone https://github.com/proximax-storage/cpp-xpx-storage-user-app.git


2 cd cpp-xpx-storage-user-app
3 git submodule update --init --recursive --remote

Due to long filenames for tests, invoking the git submodule update --init --recursive --remote command twice might help.

ATTENTION! Make sure the path to StorageClientApp.exe is less than 256 symbols.
8. Configure Visual Studio.

CMake command arguments:

-DCMAKE_PREFIX_PATH=C:\Qt\6.7.2\msvc2019_64 -DOPENSSL_ROOT_DIR=C:\OpenSSL -DCMAKE_BUILD_TYPE=Debug


CMakeSettings.json:

1 {
2 "configurations": [
3 {
4 "name": "x64-Debug",
5 "generator": "Visual Studio 17 2022 Win64",
6 "configurationType": "Debug",
7 "inheritEnvironments": [ "msvc_x64_x64" ],
8 "buildRoot": "${projectDir}\\out\\build\\${name}",
9 "installRoot": "${projectDir}\\out\\install\\${name}",
10 "cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:\\Qt\\6.7.2\\msvc2019_64 -DOPENSSL_ROOT_DIR=C:\\OpenSSL -DCMAKE
11 "buildCommandArgs": "",
12 "ctestCommandArgs": ""
13 }
14 ]
15 }

Make sure your ..\cpp-xpx-storage-user-app\CMakeLists.txt file contains the correct OpenSSL variables. For some reason, the
OpenSSL-related paths have to be doubled as variables in CMakeLists.txt and as CMake arguments:
Make sure you set -DCMAKE_BUILD_TYPE=Debug for correct deployment (copying all necessary .dlls to the folder with
StorageClientApp.exe ). If you encounter problems, you can also copy the necessary .dlls to the folder with StorageClientApp.exe by
hand:

The plugins folder ( C:\Qt\6.7.2\msvc2019_64\plugins );

dll name in Debug mode dll name in Release mode path to dll

boost_filesystem-vc143-mt- boost_filesystem-vc143-mt- C:\boost_1_xx_x\lib64-msvc-


gd-x64-1_85.dll gd-x64-1_85.dll xx.x

boost_log-vc143-mt-gd-x64- boost_log-vc143-mt-gd-x64- C:\boost_1_xx_x\lib64-msvc-


1_85.dll 1_85.dll xx.x

boost_thread-vc143-mt-gd- boost_thread-vc143-mt-gd- C:\boost_1_xx_x\lib64-msvc-


x64-1_85.dll x64-1_85.dll xx.x

drive.dll drive.dll %storageUserAppBuildFolder%


/bin/ %Debug | Release%

Qt6Cored.dll Qt6Core.dll C:\Qt\6.x.x\msvc2019_64\bin

Qt6Guid.dll Qt6Gui.dll C:\Qt\6.x.x\msvc2019_64\bin

Qt6Multimediad.dll Qt6Multimedia.dll C:\Qt\6.x.x\msvc2019_64\bin

Qt6MultimediaWidgetsd.dll Qt6MultimediaWidgets.dll C:\Qt\6.x.x\msvc2019_64\bin

Qt6Networkd.dll Qt6Network.dll C:\Qt\6.x.x\msvc2019_64\bin

Qt6Widgetsd.dll Qt6Widgets.dll C:\Qt\6.x.x\msvc2019_64\bin

sdk_external.dll sdk_external.dll %storageUserAppBuildFolder%


/bin/ %Debug || Release%

storage-crypto.dll storage-crypto.dll %storageUserAppBuildFolder%


/bin/ %Debug || Release%

torrent-sirius.dll torrent-sirius.dll %storageUserAppBuildFolder%


/bin/ %Debug || Release%

utils.dll utils.dll %storageUserAppBuildFolder%


/bin/ %Debug || Release%

xpxchaincpp.dll xpxchaincpp.dll %storageUserAppBuildFolder%


/bin/ %Debug || Release%

ATTENTION! dlls that have the ' d ' letter at the end of the name (like Qt6Cored.dll, Qt6Guid.dll, Qt6Multimediad.dll ) are meant to
be used in Debug mode. For Release mode, use Qt6Core.dll, Qt6Gui.dll, Qt6Multimedia.dll and so on, respectively.

ATTENTION! After building, it may be necessary to run CMake once again for dlls to deploy.

When running, you can right-click the Debug Output window to disable unnecessary thread and module logs and leave only cpp-xpx-
storage-usr-app logs.
9. Configure QtCreator.

Set MSVC as default kit.


Additional CMake options:

-DOPENSSL_ROOT_DIR=C:/OpenSSL -DCMAKE_BUILD_TYPE=Debug

Pay attention to slash used in path: ' / '.

Change generator to Visual Studio:

ATTENTION! After building, it may be necessary to run CMake once again for dlls to deploy. In case of problems, copy dlls manually.

10. Configure CLion.


CLion may suggest that you install OpenSSL via vcpkg. If it doesn’t, install vcpkg manager manually:

And use it to find and install OpenSSL.


It will add the line -DCMAKE_TOOLCHAIN_FILE=C:\Users\xxxxxx\.vcpkg-clion\vcpkg\scripts\buildsystems\vcpkg.cmake to your
CMake options.

CMake options:

-DCMAKE_PREFIX_PATH=C:\Qt\6.7.2\msvc2019_64 -DCMAKE_TOOLCHAIN_FILE=C:\Users\xxxxx\.vcpkg-

clion\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug

ATTENTION! After building, it may be necessary to run CMake once again for dlls to deploy. In case of problems, copy dlls manually.

ATTENTION! Logs run only in Debug mode.

You might also like