0

I'm trying to build a node editor into my ImGui tool and found a simple node widget called imnodes however when I compile the code I receive the following error. I'm fairly new to ImGui.

#error:  Please '#define IMGUI_DEFINE_MATH_OPERATORS' _BEFORE_ including imgui.h!

Simple enough, but if I define IMGUI_DEFINE_MATH_OPERATORS before imgui.h I still receive the error. I'm using ImGui release 1.89.7 and ImNodes release 0.5

There is a simple Hello World example here.

in imgui_internal.h there is a comment explaining why the error is generated.

// In 1.89.4, we moved the implementation of "courtesy maths operators" from imgui_internal.h in imgui.h
// As they are frequently requested, we do not want to encourage to many people using imgui_internal.h

Which if I'm reading the imnodes.cpp file correctly is using legacy code

#define IMGUI_DEFINE_MATH_OPERATORS
#include <imgui_internal.h>

How would I go about fixing this?

Thanks in advance...

jeremy_b
  • 1
  • 1

1 Answers1

0

I also encountered this problem but I managed to fix it. I made a public repository on Github with the fixed code. The only change I made is the namespace imnodes in small letter. Here is the link : https://github.com/LordManjush/imnodes-fix.

Amuoeba
  • 624
  • 9
  • 28
NewGuy
  • 1