Repository navigation
Description
Hi! I'm new here and just set up OpenSHC on Linux (wine) to start contributing. To check my setup I built the DLL with all the reimplementations compiled in, and the link failed on two globals. I dug into it a bit, and it looks like a regression from the recent Ghidra exports. Details below.
Summary
The last Ghidra exports regenerated src/symbols/data.asm with mangled names for two globals that differ from what MSVC 2005 emits for the declarations in src/OpenSHC/Globals/. With every reimplementation compiled in (git ls-files 'src/OpenSHC/*.cpp' > cmake/openshc-sources.txt.local), linking OpenSHC.dll fails:
TicksStartCounter.cpp.obj : error LNK2001: unresolved external symbol "public: static union _LARGE_INTEGER StructResolver::Extern<union _LARGE_INTEGER,14627816>::instance" (?instance@?$Extern@T_LARGE_INTEGER@@$0NPDDOI@@StructResolver@@2T_LARGE_INTEGER@@A)
TicksSinceCounterStart.cpp.obj : error LNK2001: unresolved external symbol "public: static union _LARGE_INTEGER StructResolver::Extern<union _LARGE_INTEGER,14627816>::instance" (?instance@?$Extern@T_LARGE_INTEGER@@$0NPDDOI@@StructResolver@@2T_LARGE_INTEGER@@A)
initializeDirectPlayAndCreateOrJoinSession.cpp.obj : error LNK2001: unresolved external symbol "public: static struct IDirectPlay4 * StructResolver::Extern<struct IDirectPlay4 *,14630168>::instance" (?instance@?$Extern@PAUIDirectPlay4@@$0NPDNBI@@StructResolver@@2PAUIDirectPlay4@@A)
DLL\OpenSHC.dll : fatal error LNK1120: 2 unresolved externals
CI does not see this because the committed cmake/openshc-sources.txt is empty.
Details
| Global | Declared type (header) | Compiler emits | data.asm has |
Introduced in |
|---|---|---|---|---|
DAT_PerformanceCounterFrequency 0x00DF33E8 |
_LARGE_INTEGER |
T_LARGE_INTEGER (union) |
U_LARGE_INTEGER (struct) |
6306080 (2026-11-05) |
DPLAY_InterfacePointer 0x00DF3D18 |
IDirectPlay4* |
PAUIDirectPlay4@@ (global namespace) |
PAUIDirectPlay4@dplay@@ (namespace dplay) |
7c6bb9e (2026-11-04) |
_LARGE_INTEGER: before 6306080 the header usedLARGE_INTEGERanddata.asmhad the correctT_(union) mangling. The export renamed the type to_LARGE_INTEGERand now mangles it as a struct. Inwinnt.h_LARGE_INTEGERis aunion, so the Ghidra type is probably defined as a struct.IDirectPlay4: 7c6bb9e changed the header fromIDirectPlay4A**toIDirectPlay4*(the olddata.asmentry wasPAPAUIDirectPlay4@@). The new entry places the type in adplaynamespace, probably taken from the Ghidra category/path ofdplay.h. The SDK declaresIDirectPlay4at global scope.
Affected reimplementations (both are marked 100% in the status file):
src/OpenSHC/Rendering/TicksStartCounter.cpp(0x0046CF10)src/OpenSHC/UI/Helpers/TicksSinceCounterStart.cpp(0x0046CF90)src/OpenSHC/Synchrony/GameSynchronyState/initializeDirectPlayAndCreateOrJoinSession.cpp(0x0047DB10)
Expected
data.asm should contain:
?instance@?$Extern@T_LARGE_INTEGER@@$0NPDDOI@@StructResolver@@2T_LARGE_INTEGER@@A EQU 00DF33E8h
?instance@?$Extern@PAUIDirectPlay4@@$0NPDNBI@@StructResolver@@2PAUIDirectPlay4@@A EQU 00DF3D18h
(plus the matching PUBLIC lines). Since data.asm is generated, I think the right fix is in the Ghidra data types (make _LARGE_INTEGER a union, keep IDirectPlay4 out of a namespace) or in the exporter's mangling, not a hand edit.
Suggestion
A CI job that builds with all of src/OpenSHC/**/*.cpp (e.g. via tools/reimplementation-helper/batch/build_parallel.py) would catch these regressions, and also cases like clearModalDialog2to6.cpp after 8125c61 (fixed in #348).
Environment
Linux, wine 10.0, MSVC1400-SP1 at c50661b, OpenSHC at 1c29459 (main, 2026-11-07).
Activity
TheRedDaemon commentedon Nov 8, 2026
Hi @gynt, can you check this?
gynt commentedon Nov 9, 2026
Thanks for reporting! @Sebauxs
Looking forward to your first contribution! Let us know if we can help out.
A fix should be up soon
gynt commentedon Nov 9, 2026
Unfortunately build times are too slow, and pushes too frequent currently to make GitHub CI run full builds after each push to main. You are free to submit PR's to repair broken changes.
resolve sourcehold#361