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

Fix linking NavigationServer2D/3D with all classes disabled in build profile #88986

Merged

Conversation

akien-mga
Copy link
Member

For some reason the destructor for NavigationMeshSourceGeometryData2D/3D being implemented in the .cpp was causing linking issues.


I was testing making minimal sized export templates with the following command:

scons target=template_release production=yes disable_3d=yes disable_advanced_gui=yes optimize=size deprecated=no minizip=no modules_enabled_by_default=no module_gdscript_enabled=yes vulkan=no wayland=no build_profile=blank.build lto=none

And this build profile which disables nearly all classes in the engine, generated from a blank project with just icon.svg, so that's the only type of resource it needs to support: blank.build.txt

I would get this linking issue:

/usr/bin/ld: servers/libservers.linuxbsd.template_release.x86_64.a(navigation_server_2d.linuxbsd.template_release.x86_64.o): in function `Ref<NavigationMeshSourceGeometryData2D>::Ref(Variant const&)':
navigation_server_2d.cpp:(.text._ZN3RefI34NavigationMeshSourceGeometryData2DEC2ERK7Variant[_ZN3RefI34NavigationMeshSourceGeometryData2DEC5ERK7Variant]+0x1f): undefined reference to `typeinfo for NavigationMeshSourceGeometryData2D'
/usr/bin/ld: servers/libservers.linuxbsd.template_release.x86_64.a(navigation_server_3d.linuxbsd.template_release.x86_64.o): in function `Ref<NavigationMeshSourceGeometryData3D>::Ref(Variant const&)':
navigation_server_3d.cpp:(.text._ZN3RefI34NavigationMeshSourceGeometryData3DEC2ERK7Variant[_ZN3RefI34NavigationMeshSourceGeometryData3DEC5ERK7Variant]+0x1f): undefined reference to `typeinfo for NavigationMeshSourceGeometryData3D'

I was puzzled to have this issue with NavigationMeshSourceGeometryData2D but not NavigationPolygon, when both are used as Ref<T> in NavigationServer2D. Comparing both classes, the main difference seemed to be the destructor implemented in the .cpp, and moving it solved the issue. The rest of the changes are just for consistency.

I don't really know why this fixes the linking issue, or why it happened before this fix. Maybe someone more versed in C++ can clarify :)

…profile

For some reason the destructor for NavigationMeshSourceGeometryData2D/3D
being implemented in the .cpp was causing linking issues.
Copy link
Contributor

@smix8 smix8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why or what but whatever works.

Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me

@akien-mga akien-mga merged commit 3125a4f into godotengine:master Feb 29, 2024
16 checks passed
@akien-mga akien-mga deleted the navigation-fix-blank-build-profile branch February 29, 2024 12:59
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.

3 participants