thedmd / imgui-node-editor

Node Editor built using Dear ImGui
MIT License
3.7k stars 545 forks source link

Compilation Error: error: redefinition of 'operator==' #301

Open bhundt opened 3 months ago

bhundt commented 3 months ago

Hi, I am trying to include imgui-node-editor in my project but I get the following compilation error:

imgui_node_editor.cpp
In file included from ../vendor/NodeEditor/src/imgui_node_editor.cpp:12:
In file included from ../vendor/NodeEditor/include/imgui_node_editor_internal.h:27:
In file included from ../vendor/NodeEditor/include/imgui_extra_math.h:71:
../vendor/NodeEditor/include/imgui_extra_math.inl:22:13: error: redefinition of 'operator=='
inline bool operator==(const ImVec2& lhs, const ImVec2& rhs)
            ^
../vendor/ImGui/include/imgui.h:2801:23: note: previous definition is here
static inline bool    operator==(const ImVec2& lhs, const ImVec2& rhs)  { return lhs.x == rhs.x && lhs.y == rhs.y; }

I included the imgui .cpp's and the imgui-node-editor .cpp's in my project and try to compile...any idea what could be wrong here?

otto-link commented 3 months ago

This operator has been included in ImGui a few month ago but is already present in the node editor, hence the conflict. I think this has been fixed in the dev branch of the node editor.