matus-chochlik / oglplus

OGLplus is a collection of open-source, cross-platform libraries which implement an object-oriented facade over the OpenGL® (version 3 and higher) and also OpenAL® (version 1.1) and EGL (version 1.4) C-language APIs. It provides wrappers which automate resource and object management and make the use of these libraries in C++ safer and more convenient.
http://oglplus.org/
Boost Software License 1.0
492 stars 72 forks source link

oglplus::Program::BuildInclude && clang 3.5 #113

Closed regnirpsj closed 9 years ago

regnirpsj commented 9 years ago

on fedora21 clang 3.5 chokes on this while gcc 4.9.2 is perfectly happy (as well as vs2013); b and d are of type std::string.

> error: no matching member function for call to 'BuildInclude'
        prg_.MakeSeparable(true).BuildInclude({ b, d, }).Link().Use();
        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
> note: candidate function not viable: cannot convert initializer list argument to 'oglplus::GLSLString'
        ObjectOps& BuildInclude(GLSLString&& incl)
                   ^
> note: candidate function not viable: cannot convert initializer list argument to 'oglplus::GLSLStrings'
        ObjectOps& BuildInclude(GLSLStrings&& incl)
                   ^
> note: candidate function not viable: cannot convert initializer list argument to 'const oglplus::GLSLSource'
        ObjectOps& BuildInclude(const GLSLSource&& incl)
                   ^

this is with a recent clone of the develop as well as the master branch.

matus-chochlik commented 9 years ago

This looks like a problem with the Boost.Config library, which for clang defines the BOOST_NO_INITIALIZER_LISTS preprocessor symbol even if initializer lists are supported. OGLplus picks this up, and disables the constructors with initializer lists.

At the moment You can fix this by defining OGLPLUS_NO_INITIALIZER_LISTS 0 before including the oglplus headers.

matus-chochlik commented 9 years ago

I did some changes to the build system and now it is possible to disable the use of the Boost.Config library (if it was detected) either by defining OGLPLUS_USE_BOOST_CONFIG 0 before including oglplus, or by specifying the --no-boost-config option to the configuration script.

HTH

regnirpsj commented 9 years ago

thanks, i'll try both later today.