Skip to content

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Oct 19, 2025

Fixes #11387

@charjr
Copy link

charjr commented Oct 19, 2025

As well as adding extern in api.h they also have to then be defined in api.c like in vnen's example https://github.com/vnen/gdextension-c-example/blob/b560e60ab5f7f6bfd4b85e71cd68ad736562ebdf/src/api.c#L5-L9

Lastly, this change #11385.

Vnen's examples use include guards, whereas the docs are using #pragma once. defs.h is documented with #pragma once at the top and then #endif //DEFS_H at the bottom. So one or the other should be changed.

@dsnopek dsnopek force-pushed the gdextension-c-extern branch 2 times, most recently from 2911711 to 6f371fa Compare October 19, 2025 14:01
@dsnopek
Copy link
Contributor Author

dsnopek commented Oct 19, 2025

As well as adding extern in api.h they also have to then be defined in api.c like in vnen's example https://github.com/vnen/gdextension-c-example/blob/b560e60ab5f7f6bfd4b85e71cd68ad736562ebdf/src/api.c#L5-L9

Yep, that's already in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GDExtension C Example: ODR violations in api.h

2 participants