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

Compile error on Windows system with VS2017 #150

Open allenyeh1105 opened 4 years ago

allenyeh1105 commented 4 years ago

My problem can be spited into three parts.

  1. The cmake procedure cannot find my real opengl version. The error message is just like this issue: https://github.com/matus-chochlik/oglplus/issues/118

  2. Maybe due to the wrong opengl version, the warning "CMake Warning at config/OGLplusLib.cmake:62 (message): OGLplus library cannot be built!" would showed up during configuration.

  3. I can ignore the warning and generate the solution. But will have compile error. Just like https://github.com/matus-chochlik/oglplus/issues/149 "oglplus\include\oglplus/glfunc.hpp(34): error C2165: 'left-side modifier': cannot modify pointers to data"

Overall, I cannot successfully build the oglplus library. Is there any settings I should change to build the library? Thanks for your reply in advance.

matus-chochlik commented 4 years ago

Hi,

@1. at the moment I don't have access to any windows machine with MSVC 2017, so if 1. is the same as in #118 and the detection segfaults I need someone with MSVC, to try and run the try_compiler executable in a debugger and find out why does it crash.

@2 This message on itself is not a problem. OGLplus should be usable without the library,

@3. Could you pls. paste the whole compiler output related to this error? Also #define OGLPLUS_NO_GLFUNC_CHECKS 1 might get rid of this problem.

allenyeh1105 commented 4 years ago

@1. I can help the check but I'm not sure the steps. In my build/gl folder, i have "has_GL_3_1.cpp", "has_GL_3_2.cpp" ~ "has_GL_4_5.cpp". But I still get the detect version error.

@3. For the oglplus (Library\OGLplus\oglplus) project, my error message is 1>------ Build started: Project: oglplus (Library\OGLplus\oglplus), Configuration: Release x64 ------ 1>object.cpp 1>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message. 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/glfunc.hpp(34): error C2165: 'left-side modifier': cannot modify pointers to data 1>program.cpp 1>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message. 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/glfunc.hpp(34): error C2165: 'left-side modifier': cannot modify pointers to data 1>prog_var.cpp 1>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message. 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/glfunc.hpp(34): error C2165: 'left-side modifier': cannot modify pointers to data 1>extension.cpp 1>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message. 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/glfunc.hpp(34): error C2165: 'left-side modifier': cannot modify pointers to data 1>shapes_utils.cpp 1>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message. 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/glfunc.hpp(34): error C2165: 'left-side modifier': cannot modify pointers to data 1>shapes_blender.cpp 1>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message. 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/imports/blend_file/struct_block_data.hpp(152): error C2833: 'operator decltype' is not a recognized operator or type 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/imports/blend_file/struct_block_data.hpp(155): note: see reference to class template instantiation 'oglplus::imports::BlendFileFlatStructTypedFieldData' being compiled 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/imports/blend_file/struct_block_data.hpp(152): error C2059: syntax error: 'newline' 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/imports/blend_file/struct_block_data.hpp(152): error C2334: unexpected token(s) preceding '{'; skipping apparent function body 1>C:\Users\yehallen\Documents\oglplus\implement\oglplus/shapes/blender_mesh.ipp(374): warning C4267: '+=': conversion from 'size_t' to 'GLuint', possible loss of data 1>debug_output.cpp 1>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message. 1>C:\Users\yehallen\Documents\oglplus\include\oglplus/glfunc.hpp(34): error C2165: 'left-side modifier': cannot modify pointers to data 1>Generating Code... 1>Done building project "oglplus.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

After I add #define OGLPLUS_NO_GLFUNC_CHECKS 1, that error disappear, but still have some others.

matus-chochlik commented 4 years ago

@1: The configure script has the --debug-config and --debug-gl-ver-error When you use both, it will cause the configuration to exit at the first GL version detection error and it will leave the try_compile executables in the build directory. When the config fails go to the build directory and IIRC there are some MSVC solutions. Try to open them and build them. If there are any build errors please paste them here, if any executables are built then try to run them in the MSVC debugger and see what happens.

@#: Paste the other error messages here please.