acdemiralp / gl

Header-only C++17 wrapper for OpenGL 4.6 Core Profile.
Boost Software License 1.0
157 stars 11 forks source link

Remove std::function<>::target() usage in debug callbacks. #6

Closed porky11 closed 6 years ago

porky11 commented 6 years ago

when calling cmake . in directory, I get folowing error message, but don't know, what it means:

CMake Error at cmake/conan.cmake:38 (find_package):
  By not providing "Findglew.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "glew", but
  CMake did not find one.

  Could not find a package configuration file provided by "glew" with any of
  the following names:

    glewConfig.cmake
    glew-config.cmake

  Add the installation prefix of "glew" to CMAKE_PREFIX_PATH or set
  "glew_DIR" to a directory containing one of the above files.  If "glew"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:93 (find_package_or_conan)

-- Configuring incomplete, errors occurred!
See also "/home/porky11/build/gl/CMakeFiles/CMakeOutput.log".
AlexanderS commented 6 years ago

FindGLEW.cmake should be included in your cmake installation. Debian f.e. installs it at /usr/share/cmake-3.7/Modules/FindGLEW.cmake. Can you check if it is there?

porky11 commented 6 years ago

After sudo ln /usr/share/cmake-3.9/Modules/{FindGLEW,Findglew}.cmake calling cmake it works. But now I get another error:

In file included from /usr/include/c++/7.2.0/functional:58:0,
                 from /home/porky11/build/gl/include/gl/debug.hpp:9,
                 from /home/porky11/build/gl/source/debug.cpp:6:
/usr/include/c++/7.2.0/bits/std_function.h: In Instanziierung von »_Functor* std::function<_Res(_ArgTypes ...)>::target() [mit _Functor = void(unsigned int, unsigned int, unsigned int, unsigned int, int, const char*, const void*); _Res = void; _ArgTypes = {unsigned int, unsigned int, unsigned int, unsigned int, int, const char*, const void*}]«:
/home/porky11/build/gl/source/debug.cpp:26:128:   von hier erfordert
/usr/include/c++/7.2.0/bits/std_function.h:733:9: Fehler: ungültige Verwendung von const_cast mit Typ »void (*)(unsigned int, unsigned int, unsigned int, unsigned int, int, const char*, const void*)«, das ein Zeiger oder Referenz auf Funktionstyp ist
  return const_cast<_Functor*>(__func);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
acdemiralp commented 6 years ago

I tried addressing this in 3db4632e8e702a37224df35c89cd977b1cf9d1a2 please let me know if it works.