updated and tested with vs2022, pg16.2, etc.

This commit is contained in:
jie 2024-03-13 19:56:57 +08:00
parent 2b544e2af0
commit 1dfa867f20
5 changed files with 18 additions and 18 deletions

View File

@ -1,8 +1,8 @@
# Build (Windows) # Build (Windows)
To build the dependencies & the project itself, The following must be installed: To build the dependencies & the project itself, The following must be installed:
- Microsoft Visual Studio 2019 (VS2019) - Microsoft Visual Studio 2019/2022 (VS2019/VS2022)
- CMake - [CMake](https://cmake.org/)
## Dependencies ## Dependencies
@ -26,17 +26,17 @@ b2
### [Crypto++](https://cryptopp.com/) ### [Crypto++](https://cryptopp.com/)
1. Go to `cryptopp`. 1. Go to `cryptopp`.
2. Use VS2019 to open `cryptest.sln`. 2. Use VS2019/VS2022 to open `cryptest.sln`.
3. For `Debug` `x64` configuration, open `Properties` of `cryptlib` project. In `C/C++` `Code Generation`, set `Runtime Library` to `Multithreading Debug DLL (/MDd)`. 3. For `Debug` `x64` configuration, open `Properties` of `cryptlib` project. In `C/C++` `Code Generation`, set `Runtime Library` to `Multithreading Debug DLL (/MDd)`.
4. For `Release` `x64` configuration, open `Properties` of `cryptlib` project. In `C/C++` `Code Generation`, set `Runtime Library` to `Multithreading DLL (/MD)`. 4. For `Release` `x64` configuration, open `Properties` of `cryptlib` project. In `C/C++` `Code Generation`, set `Runtime Library` to `Multithreading DLL (/MD)`.
5. `Batch Build` `Debug` AND `Release` `x64` of `cryptlib`. 5. `Batch Build` `Debug` AND `Release` `x64` of `cryptlib`.
### [PostgreSQL 14.0](https://www.postgresql.org/) ### [PostgreSQL](https://www.postgresql.org/)
*The database may not be installed locally. You should be able to connect to it.* *The database may not be installed locally. You should be able to connect to it.*
1. Use this [link](https://get.enterprisedb.com/postgresql/postgresql-14.0-1-windows-x64-binaries.zip) to download the binaries. 1. Use this [link](https://www.enterprisedb.com/download-postgresql-binaries) to download the binaries.
2. Unzip the zip archive here. It should be named `pgsql` and contains `bin`, `include` and `lib`. 2. Unzip the zip archive here. It should be named `pgsql` and contains `bin`, `include` and `lib`.
@ -47,9 +47,9 @@ b2
- `Browse Source...` and `Browse Build...` to the root directory of `libpqxx`. - `Browse Source...` and `Browse Build...` to the root directory of `libpqxx`.
- `Add Entry`: `PostgreSQL_INCLUDE_DIR` (`PATH`) = `../../pgsql/include` - `Add Entry`: `PostgreSQL_INCLUDE_DIR` (`PATH`) = `../../pgsql/include`
- `Add Entry`: `PostgreSQL_LIBRARY` (`FILEPATH`) = `../../pgsql/lib/libpq` - `Add Entry`: `PostgreSQL_LIBRARY` (`FILEPATH`) = `../../pgsql/lib/libpq`
- `Configure`: Use default settings (`VS2019` `x64`). - `Configure`: Use default settings (`VS2019`/`VS2022` `x64`).
- `Generate` - `Generate`
3. Use VS2019 to open `libpqxx.sln`. 3. Use VS2019/VS2022 to open `libpqxx.sln`.
4. `Batch Build` `Debug` AND `Release` `x64` of `pqxx`. 4. `Batch Build` `Debug` AND `Release` `x64` of `pqxx`.
@ -62,6 +62,6 @@ b2
> Now we should go back to the root directory. > Now we should go back to the root directory.
Use VS2019 to open `WebApp.sln`, which is a sample project. Remember to properly configure the database and `config.json` before you `Run` the project. Use VS2019/VS2022 to open `WebApp.sln`, which is a sample project. Remember to properly configure the database and `config.json` before you `Run` the project.
> `bserv` and `WebApp` should be built in `Debug` or `Release` (`x64`), NOT (`Win32`/`x86`). > `bserv` and `WebApp` should be built in `Debug` or `Release` (`x64`), NOT (`Win32`/`x86`).

View File

@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>

View File

@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>

View File

@ -2,7 +2,7 @@
#define _COMMON_HPP #define _COMMON_HPP
#ifdef _MSC_VER #ifdef _MSC_VER
#define _WIN32_WINNT 0x0601 #define _WIN32_WINNT 0x0602
#endif #endif
#include "client.hpp" #include "client.hpp"

View File

@ -10,6 +10,6 @@
// 添加要在此处预编译的标头 // 添加要在此处预编译的标头
#include "framework.h" #include "framework.h"
#define _WIN32_WINNT 0x0601 #define _WIN32_WINNT 0x0602
#endif //PCH_H #endif //PCH_H