Skip to content

Switch: declare extern "C" objects at global scope so GCC 15 links them - #19

Merged
dorPXP merged 1 commit into
dorPXP:android-portfrom
TomasUribe:switch-gcc15-extern-c
Nov 4, 2026
Merged

dorPXP merged 1 commit into
dorPXP:android-portfrom
TomasUribe:switch-gcc15-extern-c

Conversation

@TomasUribe

Copy link
Copy Markdown
Contributor

Building for Switch with devkitPro's current devkitA64 (GCC 15.2.0), WiiCompiled.elf fails to link:

undefined reference to `settings_overlay::(anonymous namespace)::kAuroraSwitchPlayerColors'
undefined reference to `(anonymous namespace)::kGuestMapSymbolCount'   (and the Addresses/Names tables)

These objects are declared extern "C" inside an unnamed namespace. GCC 15 gives those declarations the namespace, so they never match the global definitions in input_switch.cpp and guest_symbol_table.cpp. I guess GCC 16 resolves them as C names, which would explain why this doesn't show up on your build.

The fix moves the declarations out of the unnamed namespace (close it, declare, reopen) in settings_overlay.cpp and system_bridge.cpp. There is no change in behaviour. main.cpp already declares them at global scope, so it isn't touched.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dorPXP
dorPXP merged commit 4befb2f into dorPXP:android-port Nov 4, 2026
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.

2 participants