Cinder icon indicating copy to clipboard operation
Cinder copied to clipboard

can't build Cairo based samples on Linux

Open dsowa opened this issue 8 years ago • 3 comments

I'm new to the Cinder codebase so hopefully I'm not just missing something obvious. I've built libcinder without any issues and now I'm going through the samples and some work, some don't.

In the case of the Cairo based sample CairoBasic you start with some simple missing include files and if you fix those then eventually you get

/home/blahh/github/Cinder/samples/CairoBasic/src/CairoBasicApp.cpp:115:29: error: no type named 'createWindowSurface' in namespace 'cinder::cairo'
        cairo::Context ctx( cairo::createWindowSurface() );     
                            ~~~~~~~^

and if you look in blocks/Cairo/src/Cairo.cpp you see the definition

#if defined( CINDER_MSW )
cairo::SurfaceGdi createWindowSurface()
{
	return cairo::SurfaceGdi( cinder::app::App::get()->getRenderer()->getDc() );
}
#elif defined( CINDER_MAC )
cairo::SurfaceQuartz createWindowSurface()
{
	auto cgContext = cinder::app::App::get()->getRenderer()->getCgContext();
	auto height = cinder::app::getWindowHeight();
	CGContextTranslateCTM( cgContext, 0.0, height );
	CGContextScaleCTM( cgContext, 1.0, -1.0 );
	return cairo::SurfaceQuartz( cgContext, cinder::app::getWindowWidth(), height );
}
#endif

There is no Linux definition for createWindowSurface()

I see that @ryanbartley has a big Cairo pull in the queue, does that fix this?

dsowa avatar Apr 11 '17 18:04 dsowa

Can confirm that building the samples on linux currently bombs out:

[ 48%] Building CXX object samples/CairoBasic/proj/cmake/CMakeFiles/CairoBasic.dir/__/__/src/CairoBasicApp.cpp.o
cd /var/tmp/CinderBuild/samples/CairoBasic/proj/cmake && /usr/bin/c++  -DCINDER_GL_CORE -DFT2_BUILD_LIBRARY -DFT_DEBUG_LEVEL_TRACE -D_GLFW_X11 -D_GLIBCXX_USE_CXX11_ABI=0 -D_UNIX -isystem /var/tmp/Cinder/include  -std=c++14  -g   -Wfatal-errors -std=c++14 -o CMakeFiles/CairoBasic.dir/__/__/src/CairoBasicApp.cpp.o -c /var/tmp/Cinder/samples/CairoBasic/src/CairoBasicApp.cpp
/var/tmp/Cinder/samples/CairoBasic/src/CairoBasicApp.cpp:6:10: fatal error: cinder/cairo/Cairo.h: No such file or directory
 #include "cinder/cairo/Cairo.h"
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [samples/CairoBasic/proj/cmake/CMakeFiles/CairoBasic.dir/build.make:66: samples/CairoBasic/proj/cmake/CMakeFiles/CairoBasic.dir/__/__/src/CairoBasicApp.cpp.o] Error 1

rowet avatar Nov 09 '18 21:11 rowet

@dsowa ,

after two years, there is still no cairo::SurfaceGdi createWindowSurface() for linux. What a pity.

Eli

3togo avatar Aug 03 '19 17:08 3togo

Is there a createWindowSurface. Unfortunately, most of the samples I try to compile have an incomplete Linux interface (Capture, Cairo, ...)

baelamri avatar Jun 30 '21 12:06 baelamri