MinGW-w64 build of `wg_core` fails to link: `rstrtmgr` is only requested through `#pragma comment(lib)`

未關閉 適合新手
#274 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
82/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
cmake, cpp
領域
build-system

研究方向

先閱讀 clean/installer/CMakeLists.txt 和 clean/installer/build-mingw.sh,接著檢查各個建置流程如何連結 wg_core 以及如何使用 LIBS。依照 issue 中的說明,將 Restart Manager 程式庫加入兩種連結設定,並確認 MinGW 建置成功連結。

由索引模型根據 Issue 內容生成。

描述

Since the Restart Manager check in src/wg_core/record.cpp (#include <restartmanager.h> and
#pragma comment(lib, "rstrtmgr.lib")), a MinGW-w64 build fails at link time:

ld.lld: error: undefined symbol: RmStartSession
ld.lld: error: undefined symbol: RmRegisterResources
ld.lld: error: undefined symbol: RmGetList
ld.lld: error: undefined symbol: RmEndSession

#pragma comment(lib, ...) is an MSVC extension, so GCC and clang under MinGW ignore it. This hits the documented
MinGW routes: build-mingw.sh and the CMake build with a MinGW toolchain (also what clean/linux/run_wine_tests.py --tests launcher uses). The MSVC build is not affected.

Suggested fix: add rstrtmgr to target_link_libraries(wg_core PUBLIC ...) in clean/installer/CMakeLists.txt and
-lrstrtmgr to LIBS in clean/installer/build-mingw.sh (harmless with MSVC). Adding a MinGW build job to CI would
catch this kind of break; happy to send either as a small PR.

主要語言
C++
星號
12
分支
2
平均合併
3 小時 10 分鐘
30 天內合併 PR
171

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

phantoslayer21/wronggpu 的其他 Issue

查看 phantoslayer21/wronggpu 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。