Skip to content

Conversation

Sharp-Coder6989
Copy link

Summary of the Issue and Fixes

This contribution addresses two fundamental issues preventing the project from building successfully on systems using modern GNU Compiler Collection (GCC) versions, such as GCC 13+.

Aspect of the Fix Error Encountered Root Cause Technical Solution
1. Modern GCC Compatibility C++ Compilation Error (e.g., stdout, logic_error undefined) Newer GCC versions enforce stricter adherence to the C++ standard, requiring explicit inclusion of headers for C++ Standard Library features. Added missing C++ standard headers (e.g., <cstdio>, <cerrno>, <stdexcept>) to relevant C++ files to resolve undefined symbol errors.
2. Pre-existing C Language Bug Fix C Linker Error (multiple definition of 'glava_abort') Global variables (function pointers) glava_abort and glava_return were declared without extern in glava.h. In C, this results in a redundant definition of the variables in every .c file that includes the header. Added the extern keyword to the declarations in glava.h and ensured the definition (the actual instance) remained in only one source file (e.g., glava.c), thereby resolving the "multiple definition" linker bug.

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