cinder / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
5.34k stars 944 forks source link

can't build Cairo based samples on Linux #1815

Open dsowa opened 7 years ago

dsowa commented 7 years ago

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?

rowet commented 6 years ago

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
3togo commented 5 years ago

@dsowa ,

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

Eli

baelamri commented 3 years ago

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