Skip to content

Godot 4+(master) GDExtension C++ example instructions on macos not working #7246

Open
@jpedrick

Description

@jpedrick

Your Godot version:

% git rev-parse HEAD
2ff3cf9bf91dc532b0f435079aaf2ae6eee8609f

Issue description:

On MacOS gdexample.gdextension doesn't point to correct library:

ERROR: Can't open dynamic library: /Users/jpedrick/Development/godot-master-cpp-tutorial/cpp-tutorial/demo/bin/libgdexample.macos.framework, error: dlopen(/Users/jpedrick/Development/godot.git/bin/../Frameworks/libgdexample.macos.framework, 0x0002): tried: '/Users/jpedrick/Development/godot.git/bin/../Frameworks/libgdexample.macos.framework' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/jpedrick/Development/godot.git/bin/../Frameworks/libgdexample.macos.framework' (no such file), '/Users/jpedrick/Development/godot.git/bin/../Frameworks/libgdexample.macos.framework' (no such file).
   at: open_dynamic_library (platform/macos/os_macos.mm:191)
ERROR: GDExtension dynamic library not found: /Users/jpedrick/Development/godot-master-cpp-tutorial/cpp-tutorial/demo/bin/libgdexample.macos.framework
   at: open_library (core/extension/gdextension.cpp:400)
ERROR: Failed loading resource: res://bin/gdexample.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:223)

Two fixes are needed:

  1. scons platform=macos => scons platform=macos target=editor
  2. gdexample.gdextension =>
[configuration]

entry_symbol = "example_library_init"

[libraries]

linux.64="res://bin/libgdexample.linux.64.so"
windows.x86_64="res://bin/libgdexample.windows.x86_64.dll"
macos="res://bin/libgdexample.macos.editor.framework/libgdexample.macos.editor"

URL to the documentation page:

https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions