segross / UnrealImGui

Unreal plug-in that integrates Dear ImGui framework into Unreal Engine 4.
MIT License
666 stars 212 forks source link

ImGui.h compilation errors with Editor configs #3

Closed Unit2Ed closed 6 years ago

Unit2Ed commented 6 years ago

I'm integrating this with my project, and after adding & compiling the plugin (and checking the demo window works), I'm trying to use the library.

I've added a simple #include to one of our cpp files, and I'm seeing these compilation errors when compiled under DebugGame Editor (or any other Editor config):

1>  C:\Game\Plugins\ImGui\Source\ThirdParty\ImGuiLibrary\Include\imgui.h(130): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>  C:\Game\Plugins\ImGui\Source\ThirdParty\ImGuiLibrary\Include\imgui.h(130): error C2146: syntax error: missing ';' before identifier 'ImGuiIO'
1>  C:\Game\Plugins\ImGui\Source\ThirdParty\ImGuiLibrary\Include\imgui.h(131): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>  C:\Game\Plugins\ImGui\Source\ThirdParty\ImGuiLibrary\Include\imgui.h(131): error C2086: 'int ImGui::DLLIMPORT': redefinition
(and many more similar)

They don't occur with non-Editor configs (eg DebugGame Client, DebugGame, Development Client), so I assume it's something to do with linking ImGui as a DLL vs static lib.

Unit2Ed commented 6 years ago

Fixed - I was missing a #include "ImGuiModule.h" first.