Skip to content
github-actions[bot] edited this page Jul 16, 2026 · 1 revision

构建

把 wknet 编成可链接的静态库 wknetlib.lib,并接到你的驱动工程。

环境

组件 要求
操作系统 Windows 10/11 或 Windows Server 2016+
Visual Studio 2022+(含 C++ 桌面与驱动开发组件)
Windows SDK 10.0.19041.0 或更高
WDK 与 SDK 版本匹配

使用 pwsh,不要用 powershell

编库

# 全部配置 x 全部内核 ABI(x64、ARM64)
pwsh -NoLogo -NoProfile -File .	oolsuild-lib.ps1

# 单 ABI
pwsh -NoLogo -NoProfile -File .	oolsuild-lib.ps1 -Configuration Debug -Platform x64

# 或直接 msbuild
msbuild wknet.sln /m /restore /p:Configuration=Release /p:Platform=x64

产物路径:

src/wknetlib/<Platform>/<Configuration>/wknetlib.lib

例如 src/wknetlib/x64/Release/wknetlib.lib

接到驱动工程

  1. 包含总头:
#include <wknet/Wknet.h>
  1. 项目属性:
附加包含目录 $(SolutionDir)include(或你的仓库 include
附加库目录 指向含 wknetlib.lib 的目录
附加依赖项 wknetlib.lib
  1. wknetlib 工程加入解决方案并设为依赖,保证先编库。

Wknet.h 只聚合公共 http / websocket / crypto / codec 头,不包含内部 session、transport 或 engine 头。

下一步


English

Build

Build wknet into the static library wknetlib.lib and link it from your driver project.

Requirements

Component Requirement
OS Windows 10/11 or Windows Server 2016+
Visual Studio 2022+ (C++ desktop + driver workloads)
Windows SDK 10.0.19041.0 or newer
WDK Matching the SDK version

Use pwsh, not powershell.

Build the library

# All configurations × kernel ABIs (x64, ARM64)
pwsh -NoLogo -NoProfile -File .\tools\build-lib.ps1

# Single ABI
pwsh -NoLogo -NoProfile -File .\tools\build-lib.ps1 -Configuration Debug -Platform x64

# Or msbuild directly
msbuild wknet.sln /m /restore /p:Configuration=Release /p:Platform=x64

Output path:

src/wknetlib/<Platform>/<Configuration>/wknetlib.lib

Example: src/wknetlib/x64/Release/wknetlib.lib.

Wire into a driver project

  1. Include the umbrella header:
#include <wknet/Wknet.h>
  1. Project settings:
Setting Value
Additional include directories $(SolutionDir)include (or your repo include)
Additional library directories Directory that contains wknetlib.lib
Additional dependencies wknetlib.lib
  1. Add the wknetlib project to the solution and set a project dependency so the library builds first.

Wknet.h only aggregates the public http / websocket / crypto / codec headers. It does not include internal session, transport, or engine headers.

Next

Clone this wiki locally