Linux CMake lib prefix not generated

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

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
cmake
领域
build-system

调研方向

先克隆模板并在 Linux 上运行其 CMake 构建,然后将生成的共享库文件名与 CMake 列表文件和 .gdextension 文件中的名称进行比较。当干净的 CMake 构建生成的名称能够被模板的 .gdextension 文件加载,且不再出现所报告的 ERR_FILE_NOT_FOUND 错误时,即表示完成。

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

描述

bug
Godot version

v 4.6.1

godot-cpp version

current - cloned today

System information

Linux Open suse Tumbleweed

Issue description

I recently had a problem working on an extension and didn't notice the problem for a while because I always built things first with scons. However on a recent project I had not built with scons I started getting file not found errors for the generated shared library.

After solving my user errors, I still had to edit the .gdextension file to adjust the name of the built library file because the cmake build does not add the lib prefix.

To confirm this I cloned the template and tried building it without any changes using cmake. The template builds and launches but there are errors:

ERROR: Condition "!FileAccess::exists(path)" is true. Returning: ERR_FILE_NOT_FOUND
   at: open_dynamic_library (drivers/unix/os_unix.cpp:1061)
ERROR: Condition "!FileAccess::exists(path)" is true. Returning: ERR_FILE_NOT_FOUND
   at: open_dynamic_library (drivers/unix/os_unix.cpp:1061)
ERROR: GDExtension dynamic library not found: 'res://bin/example.gdextension'.
   at: open_library (core/extension/gdextension.cpp:740)
ERROR: Error loading extension: 'res://bin/example.gdextension'.

To fix I had to add the lib prefix explicitly to the libname variable in the cmake lists file or edit the gdextnsions file to omit the lib prefix in the library name.

not sure if related to #38 or #107 ?

Edit:
Here's a screenshot in case it's unclear what I mean. At the top is the library file that is generated, and at the bottom the gdextension file. Note the library generated lacks the lib prefix that is present in the gdextension file for each of the library file names.

Image
主要语言
Python
星标
499
派生
140
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

godotengine/godot-cpp-template 的其他 Issue

查看 godotengine/godot-cpp-template 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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