cimgui / cimnodes

C wrapping of https://github.com/Nelarius/imnodes
29 stars 16 forks source link

namespace: wrong name? #6

Closed gucio321 closed 1 year ago

gucio321 commented 1 year ago

Hi I'm trying to build shared library with cmake and getting this:

# ...
/home/me/git/cimgui-go/cimgui/cimnodes.cpp: In function ‘void imnodes_ClearLinkSelection_Int(int)’:
/home/mszeptuch/git/cimgui-go/cimgui/cimnodes.cpp:292:12: error: ‘imnodes’ has not been declared
  292 |     return imnodes::ClearLinkSelection(link_id);
      |            ^~~~~~~
# ...

After sed -e s/imnodes/ImNodes/g cimnodes.cpp everything works fine.

sonoro1234 commented 1 year ago

Your cmake needs https://github.com/sonoro1234/LuaJIT-ImGui/blob/docking_inter/CMakeLists.txt#L13

This was needed because name collision with cimnodes_r

It is explained in the readme.md

gucio321 commented 1 year ago

ok, I see thank you.

gucio321 commented 1 year ago

@sonoro1234 just by the way, do you have any idea why something like that happens?

# github.com/AllenDang/cimgui-go
In file included from cimnodes_wrapper.h:6,
                 from cimnodes_structs_accessor.cpp:5:
cimgui/cimnodes.h:111:29: error: declaration of ‘EmulateThreeButtonMouse ImNodesIO::EmulateThreeButtonMouse’ changes meaning of ‘EmulateThreeButtonMouse’ [-fpermissive]
  111 |     EmulateThreeButtonMouse EmulateThreeButtonMouse;
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
cimgui/cimnodes.h:95:40: note: ‘EmulateThreeButtonMouse’ declared here as ‘typedef struct EmulateThreeButtonMouse EmulateThreeButtonMouse’
   95 | typedef struct EmulateThreeButtonMouse EmulateThreeButtonMouse;
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~
cimgui/cimnodes.h:112:33: error: declaration of ‘LinkDetachWithModifierClick ImNodesIO::LinkDetachWithModifierClick’ changes meaning of ‘LinkDetachWithModifierClick’ [-fpermissive]
  112 |     LinkDetachWithModifierClick LinkDetachWithModifierClick;
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cimgui/cimnodes.h:101:44: note: ‘LinkDetachWithModifierClick’ declared here as ‘typedef struct LinkDetachWithModifierClick LinkDetachWithModifierClick’
  101 | typedef struct LinkDetachWithModifierClick LinkDetachWithModifierClick;
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cimgui/cimnodes.h:113:28: error: declaration of ‘MultipleSelectModifier ImNodesIO::MultipleSelectModifier’ changes meaning of ‘MultipleSelectModifier’ [-fpermissive]
  113 |     MultipleSelectModifier MultipleSelectModifier;
      |                            ^~~~~~~~~~~~~~~~~~~~~~
cimgui/cimnodes.h:107:39: note: ‘MultipleSelectModifier’ declared here as ‘typedef struct MultipleSelectModifier MultipleSelectModifier’
  107 | typedef struct MultipleSelectModifier MultipleSelectModifier;
      |                                       ^~~~~~~~~~~~~~~~~~~~~~

you are deffinitly more familiar with C stuff than me :smile: