Cinder-Imgui no longer workign on rpi

Hi all,
I’ve used Cinder-Imgui on rpi a while back without issue but the latest is not compiling for me and I was wondering if anyone has come up against this. Compiles fine with cmake on OSX. To recreate the issue I cloned the repo to the cinder blocks folder and create the following proj in it’s samples/Basic/proj/cmake folder:

cmake_minimum_required( VERSION 2.8 FATAL_ERROR )
set( CMAKE_VERBOSE_MAKEFILE ON )

project( BasicApp )

get_filename_component( CINDER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.." ABSOLUTE )
get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE )

include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" )

ci_make_app(
	SOURCES     ${CINDER_PATH}/blocks/Cinder-ImGui/lib/imgui/imgui_demo.cpp
	SOURCES     ${APP_PATH}/src/BasicApp.cpp
	CINDER_PATH ${CINDER_PATH}
	BLOCKS		Cinder-ImGui
)

It configures fine but then I get the following errors compiling:

[ 14%] Building CXX object CMakeFiles/Cinder-ImGui.dir/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp.o
/usr/bin/c++   -DCINDER_GL_ES_2 -DCINDER_GL_ES_2_RPI -DCINDER_LINUX_EGL_ONLY -DFT2_BUILD_LIBRARY -DFT_DEBUG_LEVEL_TRACE -D_GLIBCXX_USE_CXX11_ABI=0 -D_UNIX -I/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/include -I/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/lib/imgui -isystem /home/pi/Documents/Cinder.git/include  -g   -std=c++14 -o CMakeFiles/Cinder-ImGui.dir/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp.o -c /home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp
/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp: In member function ‘ImFont* ImGui::Renderer::addFont(const boost::filesystem::path&, float, const ImWchar*, bool)’:
/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:537:2: error: reference to ‘Font’ is ambiguous
  Font ciFont( fontSource, size );
  ^~~~
In file included from /usr/include/X11/Xlib.h:44:0,
                 from /usr/include/EGL/eglplatform.h:119,
                 from /usr/include/EGL/egl.h:39,
                 from /home/pi/Documents/Cinder.git/include/cinder/gl/platform.h:84,
                 from /home/pi/Documents/Cinder.git/include/cinder/gl/scoped.h:26,
                 from /home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:38:
/usr/include/X11/X.h:100:13: note: candidates are: typedef XID Font
 typedef XID Font;
             ^~~~
In file included from /home/pi/Documents/Cinder.git/include/cinder/gl/draw.h:33:0,
                 from /home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:39:
/home/pi/Documents/Cinder.git/include/cinder/Font.h:55:14: note:                 class cinder::Font
 class CI_API Font {
              ^~~~
/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:552:11: error: ‘ciFont’ was not declared in this scope
  else if( ciFont.getNumGlyphs() ) {
           ^~~~~~
/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:564:3: error: reference to ‘Font’ is ambiguous
   Font::Glyph start = glyphs[0] == 0 ? '0' : glyphs[0];
   ^~~~
In file included from /usr/include/X11/Xlib.h:44:0,
                 from /usr/include/EGL/eglplatform.h:119,
                 from /usr/include/EGL/egl.h:39,
                 from /home/pi/Documents/Cinder.git/include/cinder/gl/platform.h:84,
                 from /home/pi/Documents/Cinder.git/include/cinder/gl/scoped.h:26,
                 from /home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:38:
/usr/include/X11/X.h:100:13: note: candidates are: typedef XID Font
 typedef XID Font;
             ^~~~
In file included from /home/pi/Documents/Cinder.git/include/cinder/gl/draw.h:33:0,
                 from /home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:39:
/home/pi/Documents/Cinder.git/include/cinder/Font.h:55:14: note:                 class cinder::Font
 class CI_API Font {
              ^~~~
/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:567:23: error: ‘start’ was not declared in this scope
     ranges.push_back( start );
                       ^~~~~
/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:573:22: error: ‘start’ was not declared in this scope
    ranges.push_back( start );
                      ^~~~~
CMakeFiles/Cinder-ImGui.dir/build.make:65: recipe for target 'CMakeFiles/Cinder-ImGui.dir/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp.o' failed
make[2]: *** [CMakeFiles/Cinder-ImGui.dir/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp.o] Error 1
make[2]: Leaving directory '/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/samples/Basic/proj/cmake/build'
CMakeFiles/Makefile2:70: recipe for target 'CMakeFiles/Cinder-ImGui.dir/all' failed
make[1]: *** [CMakeFiles/Cinder-ImGui.dir/all] Error 2
make[1]: Leaving directory '/home/pi/Documents/Cinder.git/blocks/Cinder-ImGui/samples/Basic/proj/cmake/build'
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2

Not sure how to fix this conflict - any advice? The older compiling version of the block I have is not rendering anything so keen to start working with latest.
cheers,
nay.

Does it help if you change CinderImGui::537 to the following?

ci::Font ciFont( fontSource, size );

Thanks! Thought I had tried that but took another look and seems I missed line 564, where I also needed to to add the namespace to ci::Font::Glyph - now it compiles!

This is great, but unfortunately the UI does not render :confused:
So it has the same issue as the older version I had compiling that used to work.

I suspect this might have something to do with the rpi not supporting certain open gl draw functions as in CinderImGui.cpp there are a bunch of checks for CINDER_LINUX_EGL_RPI2 that I made a pull request for aaaaages ago thanks to the advice of @petros - perhaps some recent changes have stopped these from working correctly but unfortunately I am not across the rpi limitations here

anyone more rpi savvy able to try it out?

Hey,

haven’t checked it at all since I don’t have much time right now but the flag has changed so this is def one issue. All CINDER_LINUX_EGL_RPI2 calls should be replaced with CINDER_GL_ES_2_RPI when working with the latest Cinder master branch.

Cheers,
Petros

Ah, Petros to the rescue yet again!
that was it - will make a PR :slight_smile: