pthom / hello_imgui

Hello, Dear ImGui: unleash your creativity in app development and prototyping

Home Page:https://pthom.github.io/hello_imgui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failure in MinGW 8.1

BigBIueWhale opened this issue · comments

An issue in the file "hello_imgui/internal/backend_impls/backend_window_helper/window_geometry_helper.cpp"
Unnecessary include:
#include <filesystem>
Causes build failure when compiling with MinGW 8.1
That's because MinGW 8.1 has a known bug where including causes a build failure: https://stackoverflow.com/a/56493176/7753444

Also requires adding this line
set(HELLOIMGUI_WIN32_EXECUTABLE OFF)
and only then
include(hello_imgui_add_app)
because otherwise the build fails with a linker error:

[build] [ 98%] Linking CXX executable hello_world.exe
[build] G__~1.EXE: error: /SUBSYSTEM:WINDOWS: No such file or directory
[build] G__~1.EXE: error: /ENTRY:mainCRTStartup: No such file or directory

That's because the correct compiler flag for MinGW to compile an executable without a console is:
target_link_options(Main PRIVATE -Wl,--subsystem,windows) # The two options are: windows, console

With those two fixes, the build succeeds.
I now created a poll request that fixes the issue
#31 (comment)

Many thanks, your PR was merged!