Skip to content

Move explicit template instantiations to end of namespace to fix Clang symbol export#125

Open
star-hengxing wants to merge 1 commit intohaosulab:mainfrom
star-hengxing:main
Open

Move explicit template instantiations to end of namespace to fix Clang symbol export#125
star-hengxing wants to merge 1 commit intohaosulab:mainfrom
star-hengxing:main

Conversation

@star-hengxing
Copy link

Clang requires the definition of class template members to be visible before the explicit instantiation in order to correctly export the symbols. When the instantiation macros (e.g., DEFINE_TEMPLATE_PLANNING_WORLD) are placed at the beginning of the file, Clang fails to emit the necessary symbols, leading to "undefined reference" errors during linking.

I have moved all explicit template instantiation macros to the end of the namespace (just before the closing brace) in the relevant .cpp files. This ensures that the full class template definition is available at the point of instantiation, which fixes the build on Clang while maintaining compatibility with GCC and MSVC.

Note: These changes were applied automatically using a script to ensure consistency across all files.

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