Skip to content

Conversation

@Kyle-Ye
Copy link
Contributor

@Kyle-Ye Kyle-Ye commented Aug 31, 2025

Summary

Fixes the linking error when using AGWeakAttribute as a dictionary key by correcting the symbol mangling from struct (V) to the expected type.

Problem

The symbol was being mangled as sSo15AGWeakAttributeVSH0B5GraphMc (struct) instead of sSo15AGWeakAttributeaSH0B5GraphMc (type alias), causing undefined symbol errors during linking.

Solution

Updated the C header declaration to use AG_SWIFT_STRUCT macro which ensures proper Swift import behavior while maintaining ABI compatibility with the system framework.

Test Plan

  • Verified that AGExample_2024 builds and runs successfully
  • Confirmed the symbol is now correctly mangled
  • Tested that AGWeakAttribute can be used as a dictionary key without link errors

Fixes #178

@Kyle-Ye Kyle-Ye merged commit d0a060c into main Aug 31, 2025
4 checks passed
@Kyle-Ye Kyle-Ye deleted the bugfix/link branch August 31, 2025 17:19
Kyle-Ye added a commit to OpenSwiftUIProject/OpenSwiftUI that referenced this pull request Aug 31, 2025
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.

AGWeakAttribute related link issue

2 participants