jvcleave / ofxImGui

Use ImGui in openFrameworks
303 stars 125 forks source link

develop brach broken #120

Closed cyrstem closed 9 months ago

cyrstem commented 1 year ago

im using the develop branch but i recently pull now its broken any ideas ??

 included from /home/jacos/OFN/addons/ofxImGui/libs/imgui/backends/imgui_impl_glfw_context_support.h:18,
                 from ../../..//addons/ofxImGui/src/EngineGLFW.cpp:14:
/home/jacos/OFN/addons/ofxImGui/src/LinkedList.hpp:59:43: error: expected unqualified-id before ‘const’
   59 |                 LinkedList<T_KEY,T_DATA>( const LinkedList<T_KEY,T_DATA>& ) = delete;
      |                                           ^~~~~
/home/jacos/OFN/addons/ofxImGui/src/LinkedList.hpp:59:42: error: expected ‘)’ before ‘const’
   59 |                 LinkedList<T_KEY,T_DATA>( const LinkedList<T_KEY,T_DATA>& ) = delete;
      |                                         ~^~~~~~
      |                                          )
/home/jacos/OFN/addons/ofxImGui/src/LinkedList.hpp: In instantiation of ‘LinkedListItem<T_KEY, T_DATA>::LinkedListItem(T_KEY*, DATA_REF, LinkedListItem<T_KEY, T_DATA>*) [with T_KEY = GLFWwindow; T_DATA = ImGuiContext*; DATA_REF = ImGuiContext*]’:
/home/jacos/OFN/addons/ofxImGui/src/LinkedList.hpp:64:46:   required from ‘void LinkedList<T_KEY, T_DATA>::add(T_KEY*, DATA_REF) [with T_KEY = GLFWwindow; T_DATA = ImGuiContext*; DATA_REF = ImGuiContext*]’
/home/jacos/OFN/addons/ofxImGui/libs/imgui/backends/imgui_impl_glfw_context_support.h:44:16:   required from here
/home/jacos/OFN/addons/ofxImGui/src/LinkedList.hpp:36:48: warning: ‘LinkedListItem<GLFWwindow, ImGuiContext*>::next’ will be initialized after [-Wreorder]
   36 |                 LinkedListItem<T_KEY, T_DATA>* next = nullptr;
      |                                                ^~~~
/home/jacos/OFN/addons/ofxImGui/src/LinkedList.hpp:28:30: warning:   ‘GLFWwindow* const LinkedListItem<GLFWwindow, ImGuiContext*>::key’ [-Wreorder]
   28 |                 T_KEY* const key;
      |                              ^~~
/home/jacos/OFN/addons/ofxImGui/src/LinkedList.hpp:32:17: warning:   when initialized here [-Wreorder]
   32 |                 LinkedListItem(T_KEY* _key, DATA_REF _data, LinkedListItem<T_KEY, T_DATA>* _next = nullptr) :
      |                 ^~~~~~~~~~~~~~
make[1]: *** [../../..//libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:361: ../../..//addons/obj/linux64/Release/ofxImGui/src/EngineGLFW.o] Error 1
make[1]: Leaving directory '/home/jacos/OFN/addons/ofxImGui/example-simple'
make: *** [../../..//libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:129: Release] Error 2
Daandelange commented 1 year ago

Hi, Sorry for the late answer. What's your OF version and what's your compiler+version ? To me it looks like it's coded in a too recent c++ version for your compiler.

cyrstem commented 1 year ago

hey its gcc --version gcc (GCC) 13.2.1

Daandelange commented 1 year ago

On OSX I have no issues compiling with either the old GCC or Clang that ship with OSX 10.12.

I'm wondering if it could be related to this, are you compiling using c++20 features ? Maybe LinkedList.hpp needs an update for recent c++ versions (which I don't yet have access to). You could try replacing lines 59 & 60 with: (I'm not sure if that does delete the copy constructor correctly)

        LinkedList( const LinkedList& ) = delete;
        LinkedList& operator=(const LinkedList&) = delete;
cyberboy666 commented 12 months ago

i was having this issue compiling for of0.12 on popos (as described here and the fix suggested above by @Daandelange solved it for me - thanks!

Daandelange commented 9 months ago

Thanks for reporting back, I just updated the develop branch with the change ;)