Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move my_singleton to utils folder. #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stan220
Copy link

@stan220 stan220 commented Dec 28, 2024

Hi, if I wanted to organize the structure in a project, then I made a small change: Move my_singleton to utils folder.
It compiles normally, but Godot can no longer load the extension.

 12:43:21 ~/stan/gdextension $ scons && godot --path project/ --import
scons: Reading SConscript files ...
Auto-detected 12 CPU cores available for build parallelism. Using 11 cores by default. You can override it with the -j argument.
Building for architecture universal on platform macos
scons: done reading SConscript files.
scons: Building targets ...
scons: `godot-cpp/bin/libgodot-cpp.macos.template_debug.universal.a' is up to date.
scons: `project/addons/example/bin/libexample.macos.debug.framework/libexample.macos.debug' is up to date.
scons: done building targets.
ERROR: Can't open dynamic library: /Users/s.aliferovich/stan/gdextension/project/addons/example/bin/libexample.macos.debug.framework. Error: dlopen(/Users/s.aliferovich/stan/gdextension/project/addons/example/bin/libexample.macos.debug.framework/libexample.macos.debug, 0x0002): symbol not found in flat namespace '__ZN11MySingleton13_bind_methodsEv'.
   at: open_dynamic_library (platform/macos/os_macos.mm:236)
ERROR: Can't open GDExtension dynamic library: /Users/s.aliferovich/stan/gdextension/project/addons/example/bin/libexample.macos.debug.framework
   at: open_library (core/extension/gdextension.cpp:802)
ERROR: Failed loading resource: res://addons/example/example.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:284)
ERROR: Error loading extension: res://addons/example/example.gdextension
   at: load_extensions (core/extension/gdextension_manager.cpp:234)
Godot Engine v4.3.stable.official.77dcf97d8 - https://godotengine.org
Vulkan 1.2.283 - Forward+ - Using Device #0: Apple - Apple M3 Pro

ERROR: Can't open dynamic library: /Users/s.aliferovich/stan/gdextension/project/addons/example/bin/libexample.macos.debug.framework. Error: dlopen(/Users/s.aliferovich/stan/gdextension/project/addons/example/bin/libexample.macos.debug.framework/libexample.macos.debug, 0x0002): symbol not found in flat namespace '__ZN11MySingleton13_bind_methodsEv'.
   at: open_dynamic_library (platform/macos/os_macos.mm:236)
ERROR: Can't open GDExtension dynamic library: /Users/s.aliferovich/stan/gdextension/project/addons/example/bin/libexample.macos.debug.framework
   at: open_library (core/extension/gdextension.cpp:802)
ERROR: Failed loading resource: res://addons/example/example.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:284)
SCRIPT ERROR: Parse Error: Identifier "MySingleton" not declared in the current scope.
          at: GDScript::reload (res://demo/test.gd:8)
ERROR: Failed to load script "res://demo/test.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript.cpp:2936)
ERROR: Cannot get class 'MyNode'.

@stan220 stan220 force-pushed the feature/subfolders-include branch from 8db1e44 to ca24b49 Compare December 28, 2024 09:52
@stan220
Copy link
Author

stan220 commented Dec 28, 2024

Oh, I fixed it 😄 . I just add sources+= Glob("src/utils/*.cpp") to SConstruct file.
By the way, @nathanfranke what about to add this example to your repo?

@stan220 stan220 force-pushed the feature/subfolders-include branch from ca24b49 to c45fcd2 Compare December 28, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant