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

Compilation with Visual Studio 2013 ? #51

Open ucacaxm opened 10 years ago

ucacaxm commented 10 years ago

Hi,

Just a question: have you tried to compile with Visual Studio 2013 ? This new version of the compiler seems to implement the c++11 default for special member function. => cmake define OGLPLUS_NO_DEFAULTED_FUNCTIONS

I have an error with all the constructors with double reference like that Angle(Angle&&) = default; // line 71, file angle.hpp also in vector.hpp and in named.hpp Compiler say that it is not a special function

I haven't checked if this compiling with gcc, nor if a constructor with the double ref (&&) is considered as a special function (but it seams that for visual it is not, or maybe there is an option to add it at the compilation ?)

Thanks, Alex

matus-chochlik commented 10 years ago

Hi,

I don't have access to any machine with VS2013 right now. Could you please do the following and test if it helps to fix this problem?

Open the ./config/cpp11/has_DEFAULTED_FUNCTIONS.cpp file and add a new constructor to the df class (on line 12):

df(df&&) = default;

and re-run the cmake configuration.

ucacaxm commented 10 years ago

Ok with that the DEFAULTED_FUNCTIONS is now FALSE.

And it works ! Thanks a lot ...

Second point with VS2013 (do not know if it really related to VS2013) but the compilation of "config/can_build_lib.cpp" gives an error (see the log bellow). The error is due to a link error: OpenGL32.lib is missin for the compilation. I solved that by adding "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" in the LIBRARY_SEARCH_PATHS. I do not remember I did that with VS2010.

The strange is all extensions are compiling without error but the "config/can_build_lib.cpp" is not compiling because of the OpenGL32.lib missing ?

... -- Could NOT find GL3W -- Could NOT find GLES3 -- Could NOT find GLFW -- Could NOT find GLFW3 -- Found GLUT: D:/alex/lib/freeglut-2.8.1/lib/freeglut.lib -- Could NOT find wxWidgets (missing: wxWidgets_FOUND) -- Found unsuitable Qt version "" from NOTFOUND -- Could NOT find SDL -- Could NOT find EGL -- GLM header files not found -- Could NOT find PNG -- Detecting support for c++11 feature 'SCOPED_ENUMS': TRUE -- Detecting support for c++11 feature 'VARIADIC_MACROS': TRUE -- Detecting support for c++11 feature 'VARIADIC_TEMPLATES': FALSE -- Detecting support for c++11 feature 'UNIFIED_INITIALIZATION_SYNTAX': TRUE -- Detecting support for c++11 feature 'INITIALIZER_LISTS': TRUE -- Detecting support for c++11 feature 'DEFAULTED_FUNCTIONS': FALSE -- Detecting support for c++11 feature 'DELETED_FUNCTIONS': TRUE -- Detecting support for c++11 feature 'EXPLICIT_CONVERSION_OPERATORS': TRUE -- Detecting support for c++11 feature 'FUNCTION_TEMPLATE_DEFAULT_ARGS': TRUE -- Detecting support for c++11 feature 'UNICODE_LITERALS': FALSE -- Detecting support for c++11 feature 'USER_DEFINED_LITERALS': FALSE -- Detecting support for c++11 feature 'CONSTEXPR': FALSE -- Detecting support for c++11 feature 'NOEXCEPT': FALSE -- Detecting support for c++11 feature 'LAMBDAS': TRUE -- Detecting support for c++11 feature 'NULLPTR': TRUE -- Detecting support for c++11 feature 'CHRONO': TRUE -- Detecting support for c++11 feature 'THREADS': TRUE -- Could NOT find Boost -- Using GLUT for GL context initialization. -- Using GLEW as GL API library -- Detecting OpenGL version -- Found GL version 4.4 -- Found GL extension: ARB_shader_subroutine -- Found GL extension: ARB_shader_atomic_counters -- Found GL extension: ARB_tessellation_shader -- Found GL extension: ARB_separate_shader_objects -- Found GL extension: ARB_transform_feedback2 -- Found GL extension: ARB_viewport_array -- Found GL extension: ARB_compatibility -- Found GL extension: EXT_direct_state_access -- Found GLEW extension: ARB_compatibility -- Found GLEW extension: EXT_direct_state_access -- Found GLEW extension: ARB_debug_output -- Found GLEW extension: ATI_meminfo -- Found GLEW extension: NV_path_rendering -- Found GLEW extension: AMD_performance_monitor CMake Warning at config/OGLplusLib.cmake:54 (message): OGLplus library cannot be built! Call Stack (most recent call first): CMakeLists.txt:186 (include)

-- Configuring done -- Generating done -- Build files have been written to: D:/alex/lib/oglplus/_build

2014-02-12 22:55 GMT+01:00 Matus Chochlik notifications@github.com:

Hi,

I don't have access to any machine with VS2013 right now. Could you please do the following and test if it helps to fix this problem?

Open the ./config/cpp11/has_DEFAULTED_FUNCTIONS.cpp file and add a new constructor to the df class (on line 12):

df(df&&) = default;

and re-run the cmake configuration.

Reply to this email directly or view it on GitHubhttps://github.com/matus-chochlik/oglplus/issues/51#issuecomment-34922760 .

matus-chochlik commented 10 years ago

OK, thanks for the feedback!

the first problem is fixed on release-0.42.0, which will be merged into develop and master probably within 24 hours after I run tests.

Regarding the second problem I've made some changes to the cmake script detecting OpenGL and the one testing if the lib can be built. Could you pull the release-0.42.0 branch and test if that helped?

ucacaxm commented 10 years ago

Regarding the second problem I've made some changes to the cmake script detecting OpenGL and the one testing if the lib can be built. Could you pull the release-0.42.0 branch and test if that helped?

The first problem is still ok with this release. About the OpenGL32.lib it does not help, but I found some discussion on Qt and other lib forum, and it seams that adding the path to "Microfost SDKs" is an usual way to find GL.

Thanks, alex

2014-02-13 7:17 GMT+01:00 Matus Chochlik notifications@github.com:

OK, thanks for the feedback!

the first problem is fixed on release-0.42.0, which will be merged into develop and master probably within 24 hours after I run tests.

Regarding the second problem I've made some changes to the cmake script detecting OpenGL and the one testing if the lib can be built. Could you pull the release-0.42.0 branch and test if that helped?

Reply to this email directly or view it on GitHubhttps://github.com/matus-chochlik/oglplus/issues/51#issuecomment-34951494 .

matus-chochlik commented 10 years ago

Hmm, could you send me the link? Is there any portable way to add the path that works with different versions of MSVC and different installation locations?

ucacaxm commented 10 years ago

QtForum (but it is not necessary a good source): http://qt-project.org/forums/viewthread/30006

A tutorial for students: http://www3.ntu.edu.sg/home/ehchua/programming/opengl/HowTo_OpenGL_C.html

I do not know if there is a standard way, before this I though that linking with glew should have been enough, since glew depend on opengl32.lib, then opengl32.lib should be added automatically.

The strange point, is why all the extension detections program works and not the "config/can_build_lib.cpp"? In GLverExt.cmake you do a try_run which seams very similar to the one in "OGLplusLib.cmake" ?

best alex

2014-02-13 9:27 GMT+01:00 Matus Chochlik notifications@github.com:

Hmm, could you send me the link? Is there any portable way to add the path that works with different versions of MSVC and different installation locations?

Reply to this email directly or view it on GitHubhttps://github.com/matus-chochlik/oglplus/issues/51#issuecomment-34957323 .

matus-chochlik commented 10 years ago

Thanks for the links.

There are some differences between the GL version/extension detection and the library build test, most notably that for the former GLUT, GLFW or GLFW3 is linked. Maybe that pulls in the right library paths. Which one of these libs do you use and where is it installed?

ucacaxm commented 10 years ago

I use FreeGLUT and it is installer in D:/alex/lib/freeglut-2.8.1/ so not in the system

2014-02-13 9:57 GMT+01:00 Matus Chochlik notifications@github.com:

Thanks for the links.

There are some differences between the GL version/extension detection and the library build test, most notably that for the former GLUT, GLFW, GLFW3 is linked. Maybe that pulls in the right library paths. Which one of these libs do you use and where is it installed?

Reply to this email directly or view it on GitHubhttps://github.com/matus-chochlik/oglplus/issues/51#issuecomment-34959233 .

matus-chochlik commented 10 years ago

Hmm, but besides the warning that the library cannot be built is there any other problem? Do the examples actually build ?

ucacaxm commented 10 years ago

Yes the examples compile, except the ParticleSystem for an erreor of operator= which does not exist.

So no problem ...

2014-02-13 11:04 GMT+01:00 Matus Chochlik notifications@github.com:

Hmm, but besides the warning that the library cannot be built is there any other problem? Do the examples actually build ?

Reply to this email directly or view it on GitHubhttps://github.com/matus-chochlik/oglplus/issues/51#issuecomment-34963905 .

matus-chochlik commented 10 years ago

OK, thanks.

This does not seem to be a showstopping bug so I'm not going to mess with it in the current release and I'm going to have a look at it after 0.42.0 is out.