Fix linker errors and compilation issues on Linux/Ubuntu 22.04 with gcc 13 #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes compilation and linker errors that occur when building zkanji on Ubuntu 22.04 with gcc 13.
Issues Fixed
1. Linker Errors for GroupCategory Template
Problem: The build failed with undefined reference errors:
undefined reference to 'GroupCategory<KanjiGroup>::categories(int)'undefined reference to 'GroupCategory<WordGroup>::categories(int)'Solution: Added explicit template instantiations for the
categories()method ingroups.cppto ensure the linker can find the required symbols.2. Missing Header Include
Problem: Compilation error due to missing
#include <cstdint>inchecked_cast.hon gcc 13.Solution: Added the required include directive.
3. Duplicate Using Declarations
Problem: Duplicate
using QComboBox::activated;declaration inzcolorcombobox.hcausing compilation errors.Solution: Commented out the duplicate declarations.
Changes Made
groups.cpp: Added explicit template instantiations forGroupCategory<KanjiGroup>andGroupCategory<WordGroup>specializationschecked_cast.h: Added#include <cstdint>headerzcolorcombobox.h: Fixed duplicate using declarations.gitignore: Updated to exclude Qt build artifacts and generated filesPlatform
Tested on: Ubuntu 22.04 with gcc 13 and Qt 5