Skip to content

Fix four build failures on macOS / clang - #76

Open
jlagedo wants to merge 4 commits into
arnaud-jamin:mainfrom
jlagedo:macos-portability
Open

jlagedo wants to merge 4 commits into
arnaud-jamin:mainfrom
jlagedo:macos-portability

Conversation

@jlagedo

@jlagedo jlagedo commented Sep 5, 2026

Copy link
Copy Markdown

Cog does not currently build for a Mac editor target. These are four independent fixes, one commit each, found while bringing a UE 5.8 project up on macOS arm64 (Apple clang 21). None of them is Mac-specific in nature — they are latent issues that MSVC and case-insensitive filesystems happen to tolerate.

1. IMGUI_USER_CONFIG names a header that does not exist

CogImgui.Build.cs defines it as "CogImGuiConfig.h", but the file is Public/CogImguiConfig.h — lowercase g. On a case-sensitive filesystem every translation unit reaching imgui.h fails with 'CogImGuiConfig.h' file not found. Every other reference in the plugin already uses the correct spelling.

2. CogEngineWindow_NetImGui.h includes the wrong generated header

It asks for CogEngineWindow_NetImgui.generated.h; UHT names the generated header after its source file, so it emits CogEngineWindow_NetImGui.generated.h.

3. Reflected property text is passed as a format string

Three ImGui::Text(TCHAR_TO_UTF8(...)) calls in CogEngineWindow_Inspector.cpp hand a runtime string straight to a printf-style function, so any percent sequence in a display name or tooltip is interpreted as a conversion specifier. clang rejects this under -Wformat-security, which is an error in an Unreal editor build. Every other Text call in that file already passes "%s" — these three are inside WITH_EDITORONLY_DATA and appear to have been missed.

4. FCogLogOutputDevice is not exported

FCogEngineWindow_OutputLog is COGENGINE_API and holds an FCogLogOutputDevice by value, but the device itself is unexported. On Windows the window's implicit constructor is emitted into the DLL and the device's constructor resolves there. clang emits that implicit constructor in the consumer's translation unit instead, so any module calling AddWindow<FCogEngineWindow_OutputLog>() fails to link:

Undefined symbols for architecture arm64:
  "FCogLogOutputDevice::FCogLogOutputDevice()", referenced from:
      FCogEngineWindow_OutputLog* UCogSubsystem::AddWindow<FCogEngineWindow_OutputLog>(FString const&)

Branched from cb1b435 rather than current main, which is what my project pins; the two commits main is ahead touch only CogWidgets.cpp, so this merges cleanly. Verified by building a UE 5.8.2 editor target to a successful link on macOS arm64. I have not rebuilt on Windows — fixes 1, 2 and 4 are inert there, and 3 is the standard "%s" form used elsewhere in the same file.

The header is Public/CogImguiConfig.h, but the define spells it CogImGuiConfig.h
with a capital G. Windows and case-insensitive macOS volumes resolve it anyway; on
a case-sensitive filesystem every translation unit that reaches imgui.h fails with
"'CogImGuiConfig.h' file not found".
UnrealHeaderTool names the generated header after its source file, so this one is
CogEngineWindow_NetImGui.generated.h. The include asked for NetImgui.generated.h,
which only resolves where the filesystem folds case.
These three calls hand a runtime string straight to ImGui::Text, so any percent
sequence in a display name or tooltip is interpreted as a conversion. clang rejects
it under -Wformat-security, which is an error in an Unreal editor build. Every other
Text call in this file already passes "%s" -- these are inside WITH_EDITORONLY_DATA
and were missed.
FCogEngineWindow_OutputLog is COGENGINE_API and holds an FCogLogOutputDevice by
value, but the device itself is unexported. On Windows the window's implicit
constructor is emitted into the DLL and the device's constructor resolves there.
clang emits that implicit constructor in the *consumer's* translation unit instead,
so a module calling AddWindow<FCogEngineWindow_OutputLog>() fails to link with an
undefined FCogLogOutputDevice::FCogLogOutputDevice().
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