Catch2 fails to link when using a CMake multi-config generator
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cmake, cpp
調査の方向性
まず、提供されている Conan と CMake のセットアップを Ninja Multi-Config で再現し、次に動作する Ninja ジェネレーターと比較します。Catch2-Target-release.cmake のコメントと設定ロジックを読み、設定がパスに追加される方法に注目してください。Multi-Config ビルドで xxx_test が、Catch2 のシンボルや main の不足なしに正常にリンクできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When Catch2 is installed using Conan into a project using CMake, and the project uses a multi-config generator such as "Ninja Multi-Config", building the project results in linker errors having to do with missing references to Catch2 symbols.
Expected behavior
Project should link successfully.
Reproduction steps
- Install Catch2 using Conan:
[test_requires]
catch2/3.6.0
- Use Conan's CMake integration to find and link against Catch2:
add_executable(xxx_test ${SOURCES_WITHOUT_MAIN} ${TEST_SOURCES})
find_package(Catch2 REQUIRED)
target_link_libraries(xxx_test PRIVATE Catch2::Catch2WithMain)
- Configure + build using CMake and the "Ninja Multi-Config" generator
cmake -G "Ninja Multi-Config" -S. -B ./build --preset=conan-release && cmake --build ./build
- Observe link errors:
FAILED: Debug/xxx_test
...
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
/usr/bin/ld: CMakeFiles/xxx_test.dir/Debug/test/XXX.test.cpp.o: in function `CATCH2_INTERNAL_TEST_0()':
/home/tom/projects/xxx/projects/xxx/test/XXX.test.cpp:6:(.text+0x4e): undefined reference to `Catch::ReusableStringStream::ReusableStringStream()'
...
Platform information:
- OS: Arch Linux
- Compiler+version: GCC v14.1.1
- Catch version: v3.6.0
- Conan version: 2.5.0
Additional context
- When changing the generator to "Ninja" things work as expected.
- The following comment exists in
Catch2-Target-release.cmake:
# FIXME: What is the result of this for multi-config? All configs adding themselves to path?
- 主要言語
- C++
- スター
- 21.6k
- フォーク
- 3.4k
- 平均マージ
- 3日 12時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
catchorg/Catch2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 2 日以内に返信
-
catch_discover_tests passes all EXTRA_ARGS as one argument対応中かも @CyberKun が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
catchorg/Catch2#3239 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Not seeing some error messages from fakeit in jetbrains rider対応中かも @Amanpal9 が 21 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
catchorg/Catch2#3228 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
catch_discover_tests fails for Emscripten/WASM tests since v3.16.0対応中かも @nafiurahman00 が 8 日前に担当しました。 オープンExtras
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
catchorg/Catch2#3241 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
catchorg/Catch2 の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cp-algorithms/cp-algorithms#1774 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
telefonicaid/fiware-orion#4836 ·
メンテナーはふだん 1 日以内に返信
-
nixd exits at startup when its parent process belongs to another user対応中かも @conao3 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nix-community/nixd#930 ·
メンテナーはふだん 2 日以内に返信
-
refactor topic-ui topic-weather
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Command-Install Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
microsoft/winget-cli#6718 ·
メンテナーはふだん 2 日以内に返信