Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Windows build fails (using MinGW toolchain)

未关闭
#11 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cmake, rust
领域
build-system

调研方向

从顶层的 CMakeLists.txt、已包含的 CMakeCargo 集成以及 my-app 和 my-lib 子目录开始;使用 CLion 的 MinGW 工具链在 Windows 上复现构建过程。追踪 Windows 链接步骤为何期望 libmy_lib.a,而构建生成的是 my_lib.lib,然后验证应用程序可以使用 MinGW 成功构建,同时不破坏 Mac 配置。

由索引模型根据 Issue 内容生成。

描述

I am getting a build error, from CLion using the MinGW toolchain, on Windows only. Builds on Mac without issues.

mingw32-make.exe[2]: *** No rule to make target 'my-lib/x86_64-pc-windows-msvc/debug/libmy_lib.a', needed by '<path-to-executable>/my-app.exe'.  Stop.
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:96: <path-to-app-project>/CMakeFiles/APP.dir/all] Error 2

It seems to be looking for a libmy_lib.a, when what is generated is my_lib.lib.

I have a top level CMakeLists.txt:

cmake_minimum_required(VERSION 3.14)
project(app)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

enable_language(Rust)
include(CMakeCargo)

include_directories("include")

add_subdirectory("my-app")
add_subdirectory("my-lib")

target_link_libraries(APP PRIVATE
        my_lib
        $<$<PLATFORM_ID:Windows>:ws2_32>
        $<$<PLATFORM_ID:Windows>:userenv>
        )

主要语言
CMake
星标
175
派生
30
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Devolutions/CMakeRust 的其他 Issue

查看 Devolutions/CMakeRust 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。