Skip to content

GDCLASS doesn't use godot namespace on StringName #918

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

Closed
Skwint opened this issue Nov 9, 2022 · 7 comments · Fixed by #920
Closed

GDCLASS doesn't use godot namespace on StringName #918

Skwint opened this issue Nov 9, 2022 · 7 comments · Fixed by #920
Labels
bug This has been identified as a bug

Comments

@Skwint
Copy link

Skwint commented Nov 9, 2022

The GDCLASS macro uses StringName instead of godot::StringName, which forces header files of exported classes to use the using keyword. It didn't use to force that and it probably shouldn't.

I'm using pull request #896.

@MachineMakesNoise
Copy link

Same problem here, on top of this the console fills up like this and the engine crashes :

...
ERROR: Condition "!method" is true. Returning: 0
at: get_builtin_method_hash (core/variant/variant_call.cpp:1235)
ERROR: Condition "!method" is true. Returning: 0
at: get_builtin_method_hash (core/variant/variant_call.cpp:1235)
ERROR: Condition "!method" is true. Returning: 0
at: get_builtin_method_hash (core/variant/variant_call.cpp:1235)
ERROR: Condition "!method" is true. Returning: 0
at: get_builtin_method_hash (core/variant/variant_call.cpp:1235)
ERROR: Condition "!method" is true. Returning: 0
at: get_builtin_method_hash (core/variant/variant_call.cpp:1235)
ERROR: Condition "!method" is true. Returning: 0
at: get_builtin_method_hash (core/variant/variant_call.cpp:1235)
...

This does not happen with #908, one can test it with https://github.com/saviilsy/HowToStartMakingGDExtensionsForGodot

@Skwint
Copy link
Author

Skwint commented Nov 9, 2022

Yep, I also have those crashes, but weirdly only in the editor - if I build the latest godot for template_debug it runs just fine including loading my extension. However, I suspect we both need to regenerate our headers and extension json files, and I'm not reporting the crash as a bug till I'm sure I'm doing it right. This bug is for the namespace problem.

@Skwint
Copy link
Author

Skwint commented Nov 9, 2022

For Saviilsy and those that find this page in a web search of the error messages, the cure for that problem seems to be to do a complete scons --clean of godot and rebuild it. The workaround for this problem is using godot::StringName.

@akien-mga akien-mga added the bug This has been identified as a bug label Nov 11, 2022
@akien-mga
Copy link
Member

CC @touilleMan

@touilleMan
Copy link
Member

I guess the example in Godot-cpp should also be modified to remove the using godot (given it's the primary way of testing changes are running fine)

@MachineMakesNoise
Copy link

For Saviilsy and those that find this page in a web search of the error messages, the cure for that problem seems to be to do a complete scons --clean of godot and rebuild it. The workaround for this problem is using godot::StringName.

I did clean from CMake side and it did not fix it. I reverted to beta 4 commit and keep it in that until next release. Easier than using latest anyway until API is stable😅

@touilleMan
Copy link
Member

I've created #920 that fix this issue ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This has been identified as a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants