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

オープン 初心者向け
#274 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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分
マージ済み PR(30日)
171

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

phantoslayer21/wronggpu のほかの issue

phantoslayer21/wronggpu の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。