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
493 stars 71 forks source link

Strict OpenGL Version Detection Fails #55

Closed SuperFXMaster closed 10 years ago

SuperFXMaster commented 10 years ago

I have tried building both the stable and development packages, but both of them show the same message. Being pretty new to CMake, I am confused. Is there a problem with my machine(specs below) or I have to set something else?

My machine specs: CMake GUI 2.8.12.1 Windows 8.1 MinGW with g++ 4.8.1

matus-chochlik commented 10 years ago

Could you please paste the cmake output ? B.T.W. MinGW is not yet an officially supported platform.

SuperFXMaster commented 10 years ago

Oh, sorry, was just in a hurry XP So I guess it's my problem, because looking at CMake output:

C:\dev>cmake oglplus-develop -- Building for: Visual Studio 12 -- The C compiler identification is MSVC 18.0.21005.1 -- The CXX compiler identification is MSVC 18.0.21005.1 -- Check for working C compiler using: Visual Studio 12 -- Check for working C compiler using: Visual Studio 12 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler using: Visual Studio 12 -- Check for working CXX compiler using: Visual Studio 12 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) -- Could NOT find GLEW -- Could NOT find GL3W -- Could NOT find GLES3 -- Could NOT find GLFW -- Could NOT find GLFW3 -- Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) -- GLUT header file not found -- 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++ feature 'SCOPED_ENUMS': TRUE -- Detecting support for c++ feature 'VARIADIC_MACROS': TRUE -- Detecting support for c++ feature 'VARIADIC_TEMPLATES': FALSE -- Detecting support for c++ feature 'UNIFIED_INITIALIZATION_SYNTAX': TRUE -- Detecting support for c++ feature 'INITIALIZER_LISTS': TRUE -- Detecting support for c++ feature 'DEFAULTED_FUNCTIONS': FALSE -- Detecting support for c++ feature 'DELETED_FUNCTIONS': TRUE -- Detecting support for c++ feature 'EXPLICIT_CONVERSION_OPERATORS': TRUE -- Detecting support for c++ feature 'FUNCTION_TEMPLATE_DEFAULT_ARGS': TRUE -- Detecting support for c++ feature 'UNICODE_LITERALS': FALSE -- Detecting support for c++ feature 'USER_DEFINED_LITERALS': FALSE -- Detecting support for c++ feature 'CONSTEXPR': FALSE -- Detecting support for c++ feature 'NOEXCEPT': FALSE -- Detecting support for c++ feature 'LAMBDAS': TRUE -- Detecting support for c++ feature 'NULLPTR': TRUE -- Detecting support for c++ feature 'CHRONO': TRUE -- Detecting support for c++ feature 'THREADS': TRUE -- Could NOT find Boost CMake Error at CMakeLists.txt:126 (message): No OpenGL context initialization library found!

-- Configuring incomplete, errors occurred! See also "C:/dev/CMakeFiles/CMakeOutput.log".

It only detects VS 2012 Express, for witch I did not set the INIT and LOAD libs, and it's not officially supported, too. I guess my only choice is VS 2011.

When do you plan on adding support for MinGW?

matus-chochlik commented 10 years ago

Hmm, MSVC12 should work fine. You just need to install and specify paths to GLUT or GLFW and GLEW include and library directories. You can do this for example by using the --include-dir and --library-dir options of the configure script (configure.bat or even better configure.py if you have python installed)

I don't have an exact deadline for adding MinGW support, I can have a look at it but no promises yet.

HTH

SuperFXMaster commented 10 years ago

Now I am trying to compile with the Python script, but it seems it can't detect the gl version, then it shows: C:\dev\oglplus-develop>python2 configure.py --use-gl-init-lib SDL --use-gl-api-lib GLEW --include-dir C:\dev\vslib\include --library-dir C:\dev\vslib\lib -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) -- Found GLEW: C:/dev/vslib/include C:/dev/vslib/lib/glew32.lib -- Could NOT find GL3W -- Could NOT find GLES3 -- Could NOT find GLFW -- Could NOT find GLFW3 -- Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) -- GLUT header file not found -- Could NOT find wxWidgets (missing: wxWidgets_FOUND) -- Found SDL: C:/dev/vslib/include C:/dev/vslib/lib/SDL.lib -- Could NOT find EGL -- Could NOT find PNG -- Could NOT find Boost -- Using SDL for GL context initialization. -- Using GLEW as GL API library -- Detecting OpenGL version Could not detect GL version, assuming 3.0 -- Found GL extension: NV_path_rendering -- 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:63 (message): OGLplus library cannot be built! Call Stack (most recent call first): CMakeLists.txt:183 (include)

-- Skipping '001_triangle' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '001_triangle_glsl120' because 'GL_VERSION_3_0' not implemented prop erly. -- Skipping '002_rect' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '002_shader_lit' because 'USER_DEFINED_LITERALS' not implemented pro perly. -- Skipping '002_shader_lit' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '002_triangle' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '003_rect' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '003_triangle' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '004_newton' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '004_rect' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '005_mandelbrot' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '006_cartoon_sun' because 'GL_VERSION_3_0' not implemented properly.

-- Skipping '006_newton_zoom' because 'GL_VERSION_3_0' not implemented properly.

-- Skipping '007_cubic_bezier' because 'GL_VERSION_3_0' not implemented properly . -- Skipping '008_lyapunov' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '009_metaballs' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '010_cmy_cube_glsl120' because 'GL_VERSION_3_0' not implemented prop erly. -- Skipping '010_rgb_cube' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '011_writing' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '012_checker_sphere' because 'GL_VERSION_3_1' not implemented proper ly. -- Skipping '013_spiral_sphere' because 'GL_VERSION_3_1' not implemented properl y. -- Skipping '013_striped_cubes' because 'GL_VERSION_3_0' not implemented properl y. -- Skipping '014_multi_cube' because 'GL_VERSION_3_1' not implemented properly. -- Skipping '014_multi_cube_gs' because 'GL_VERSION_3_0' not implemented properl y. -- Skipping '014_multi_cube_ub' because 'GL_VERSION_3_3' not implemented properl y. -- Skipping '015_graph' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '015_obj_mesh' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '016_cartoon_torus' because 'GL_VERSION_3_1' not implemented properl y. -- Skipping '016_metallic_torus' because 'GL_VERSION_3_1' not implemented proper ly. -- Skipping '016_noise_torus' because 'GL_VERSION_3_3' not implemented properly.

-- Skipping '016_textured_cube' because 'PNG' not found. -- Skipping '016_textured_cube' because 'GL_VERSION_3_0' not implemented properl y. -- Skipping '016_textured_cube_glsl120' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '017_clipped_torus' because 'GL_VERSION_3_1' not implemented properl y. -- Skipping '017_phong_torus' because 'GL_VERSION_3_1' not implemented properly.

-- Skipping '017_single_pass_edges' because 'GL_VERSION_3_0' not implemented pro perly. -- Skipping '017_sky_box' because 'PNG' not found. -- Skipping '017_sky_box' because 'GL_VERSION_3_1' not implemented properly. -- Skipping '018_atomic_counters' because 'GL_VERSION_3_3' not implemented prope rly. -- Skipping '018_newton_landscape' because 'GL_VERSION_3_1' not implemented prop erly. -- Skipping '018_particle_system' because 'GL_VERSION_3_0' not implemented prope rly. -- Skipping '018_stained_glass_cube' because 'PNG' not found. -- Skipping '018_stained_glass_cube' because 'GL_VERSION_3_0' not implemented pr operly. -- Skipping '019_bpatch_tess' because 'GL_VERSION_3_3' not implemented properly.

-- Skipping '019_gs_tessell' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '019_helium' because 'GL_VERSION_3_1' not implemented properly. -- Skipping '019_honeycomb_cube' because 'PNG' not found. -- Skipping '019_honeycomb_cube' because 'GL_VERSION_3_0' not implemented proper ly. -- Skipping '019_subsurf_scatter' because 'GL_VERSION_3_1' not implemented prope rly. -- Skipping '019_tessellation' because 'GL_VERSION_3_3' not implemented properly . -- Skipping '020_checkered_objects' because 'GL_VERSION_3_1' not implemented pro perly. -- Skipping '020_cube_mapping' because 'GL_VERSION_3_0' not implemented properly . -- Skipping '020_golf_ball' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '020_icosphere' because 'PNG' not found. -- Skipping '020_icosphere' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '020_octree' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '020_shaded_objects' because 'GL_VERSION_3_1' not implemented proper ly. -- Skipping '020_texture_projection' because 'PNG' not found. -- Skipping '020_texture_projection' because 'GL_VERSION_3_0' not implemented pr operly. -- Skipping '021_cloud' because 'GL_VERSION_3_0' not implemented properly. -- Skipping '021_morphing' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '021_overdraw' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '021_translucent_arrow' because 'GL_VERSION_3_0' not implemented pro perly. -- Skipping '021_wooden_crate' because 'PNG' not found. -- Skipping '021_wooden_crate' because 'GL_VERSION_3_0' not implemented properly . -- Skipping '022_blender_mesh' because 'GL_VERSION_3_3' not implemented properly . -- Skipping '022_parallax_map' because 'GL_VERSION_3_0' not implemented properly . -- Skipping '022_vase' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '022_volumetric_light' because 'PNG' not found. -- Skipping '022_volumetric_light' because 'GL_VERSION_3_3' not implemented prop erly. -- Skipping '022_xyz_planes' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '023_lattice_torus' because 'GL_VERSION_3_1' not implemented properl y. -- Skipping '023_reflected_cube' because 'GL_VERSION_3_0' not implemented proper ly. -- Skipping '023_sky' because 'PNG' not found. -- Skipping '023_sky' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '023_waves' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '024_extruded_torus' because 'GL_VERSION_3_3' not implemented proper ly. -- Skipping '024_particle_trails' because 'GL_VERSION_3_0' not implemented prope rly. -- Skipping '024_simple_picking' because 'GL_VERSION_3_3' not implemented proper ly. -- Skipping '025_multi_viewport' because 'GL_VERSION_3_3' not implemented proper ly. -- Skipping '025_recursive_texture' because 'GL_VERSION_3_2' not implemented pro perly. -- Skipping '025_reflected_torus' because 'GL_VERSION_3_3' not implemented prope rly. -- Skipping '025_rendered_texture' because 'GL_VERSION_3_2' not implemented prop erly. -- Skipping '025_rendered_texture_mt' because 'GL_VERSION_3_2' not implemented p roperly. -- Skipping '025_subroutines' because 'GL_VERSION_3_3' not implemented properly.

-- Skipping '026_clouds' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '026_furry_torus' because 'PNG' not found. -- Skipping '026_furry_torus' because 'GL_VERSION_3_3' not implemented properly.

-- Skipping '026_shape_halo' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '026_stencil_shadow' because 'GL_VERSION_3_3' not implemented proper ly. -- Skipping '027_brain_scan_vis' because 'GL_VERSION_3_0' not implemented proper ly. -- Skipping '027_depth_of_field' because 'GL_VERSION_3_3' not implemented proper ly. -- Skipping '027_flow' because 'PNG' not found. -- Skipping '027_flow' because 'GL_VERSION_3_2' not implemented properly. -- Skipping '027_reflected_shape' because 'GL_VERSION_3_3' not implemented prope rly. -- Skipping '027_smoke_trails' because 'GL_VERSION_3_0' not implemented properly . -- Skipping '027_tessellation' because 'GL_VERSION_3_3' not implemented properly . -- Skipping '028_depth_map_sss' because 'GL_VERSION_3_0' not implemented properl y. -- Skipping '028_glass_shape' because 'GL_VERSION_3_3' not implemented properly.

-- Skipping '028_monkeycraft' because 'PNG' not found. -- Skipping '028_monkeycraft' because 'GL_VERSION_3_3' not implemented properly.

-- Skipping '028_ripples' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '028_volume' because 'VARIADIC_TEMPLATES' not implemented properly. -- Skipping '028_volume' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '029_fire_hydrant' because 'PNG' not found. -- Skipping '029_fire_hydrant' because 'GL_VERSION_3_3' not implemented properly . -- Skipping '029_flares' because 'PNG' not found. -- Skipping '029_flares' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '029_muddy_stones' because 'PNG' not found. -- Skipping '029_muddy_stones' because 'GL_VERSION_3_1' not implemented properly . -- Skipping '029_shadow_mapping' because 'GL_VERSION_3_3' not implemented proper ly. -- Skipping '029_surface' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '029_waves' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '030_cube_mapping' because 'GL_VERSION_3_2' not implemented properly . -- Skipping '030_light_rays' because 'GL_VERSION_3_2' not implemented properly. -- Skipping '030_pin_display' because 'GL_VERSION_3_3' not implemented properly.

-- Skipping '030_pool_tiles' because 'PNG' not found. -- Skipping '030_pool_tiles' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '030_rain' because 'PNG' not found. -- Skipping '030_rain' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '031_blob' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '031_brick_torus' because 'PNG' not found. -- Skipping '031_brick_torus' because 'GL_VERSION_3_1' not implemented properly.

-- Skipping '031_fog' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '031_motion_blur' because 'GL_VERSION_3_3' not implemented properly.

-- Skipping '031_neon' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '031_sketch' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '032_bar_grid' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '032_object_tracking' because 'UNICODE_LITERALS' not implemented pro perly. -- Skipping '032_object_tracking' because 'GL_VERSION_3_3' not implemented prope rly. -- Skipping '032_transitions' because 'GL_VERSION_3_3' not implemented properly.

-- Skipping '033_metal_and_glass' because 'GL_VERSION_3_3' not implemented prope rly. -- Skipping '033_steam' because 'GL_VERSION_3_1' not implemented properly. -- Skipping '034_billiard_balls' because 'PNG' not found. -- Skipping '034_billiard_balls' because 'VARIADIC_TEMPLATES' not implemented pr operly. -- Skipping '034_billiard_balls' because 'GL_VERSION_3_3' not implemented proper ly. -- Skipping '040_jelly_cube' because 'GL_VERSION_3_3' not implemented properly. -- Skipping '041_blob_mt' because 'GL_VERSION_3_3' not implemented properly. -- Configuring done -- Generating done -- Build files have been written to: C:/dev/oglplus-develop/_build Configuration completed successfully.

NOTE: installing to 'C:/Program Files (x86)/DumpInformation' may require admin istrative privilegues

matus-chochlik commented 10 years ago

OK, currently the GL version detection requires either GLUT, GLFW or GLFW 3, it does not work with SDL yet (I plan to fix this in the next release). But you can skip the version detection and specify the max GL version supported by your HW/drivers manually, for example if your driver supports GL 4.3 you can call configure with the following options:

python2 configure.py --use-gl-init-lib SDL --use-gl-api-lib GLEW --include-dir C:\dev\vslib\include --library-dir C:\dev\vslib\lib --strict-gl-version-detection False --max-gl-version 4.3

HTH

matus-chochlik commented 10 years ago

I've added support for SDL to the GL version/extension detection module of the build system. It works on ubuntu but I didn't have the opportunity to test it on a machine with MSVC yet. So you can pull the latest changes from develop, try it out (without the --strict-gl-version-detection and --max-gl-version options) ale pls. let me know if it works for you.

SuperFXMaster commented 10 years ago

Disabling the --strict-gl-version-detection option gave me good results, however, with the new develop release, it outputs the following:

/////////////////////////////////////////// C:\dev\oglplus-develop>python2 configure.py --use-sdl --use-glew --include-dir=C :\dev\vslib\include --library-dir=C:\dev\vslib\lib -- Building for: Visual Studio 12 -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) -- Found GLEW: C:/dev/vslib/include C:/dev/vslib/lib/glew32.lib -- Could NOT find GL3W -- Could NOT find GLES3 -- Could NOT find GLFW -- Could NOT find GLFW3 -- Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) -- GLUT header file not found -- Could NOT find wxWidgets (missing: wxWidgets_FOUND) -- Found SDL: C:/dev/vslib/include C:/dev/vslib/lib/SDL.lib -- Could NOT find EGL -- Found PNG: C:/dev/vslib/include C:/dev/vslib/lib/png.lib -- Detecting support for c++ feature 'SCOPED_ENUMS': TRUE -- Detecting support for c++ feature 'VARIADIC_MACROS': TRUE -- Detecting support for c++ feature 'VARIADIC_TEMPLATES': FALSE -- Detecting support for c++ feature 'UNIFIED_INITIALIZATION_SYNTAX': TRUE -- Detecting support for c++ feature 'INITIALIZER_LISTS': TRUE -- Detecting support for c++ feature 'DEFAULTED_FUNCTIONS': FALSE -- Detecting support for c++ feature 'DELETED_FUNCTIONS': TRUE -- Detecting support for c++ feature 'EXPLICIT_CONVERSION_OPERATORS': TRUE -- Detecting support for c++ feature 'FUNCTION_TEMPLATE_DEFAULT_ARGS': TRUE -- Detecting support for c++ feature 'UNICODE_LITERALS': FALSE -- Detecting support for c++ feature 'USER_DEFINED_LITERALS': FALSE -- Detecting support for c++ feature 'CONSTEXPR': FALSE -- Detecting support for c++ feature 'NOEXCEPT': FALSE -- Detecting support for c++ feature 'LAMBDAS': TRUE -- Detecting support for c++ feature 'NULLPTR': TRUE -- Detecting support for c++ feature 'CHRONO': TRUE -- Detecting support for c++ feature 'THREADS': TRUE -- Could NOT find Boost -- Using SDL for GL context initialization. -- Using GLEW as GL API library -- Detecting OpenGL version CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied Could not detect GL version, assuming 3.0 CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied -- Found GLEW extension: ARB_compatibility CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied -- Found GLEW extension: EXT_direct_state_access CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied -- Found GLEW extension: ARB_debug_output CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied -- Found GLEW extension: ATI_meminfo CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied -- Found GLEW extension: NV_path_rendering CMake Error: Remove failed on file: C:/dev/oglplus-develop/_build/gl/CMakeFiles/ CMakeTmp/Debug/cmTryCompileExec493237273.exe: System Error: Permission denied -- Found GLEW extension: AMD_performance_monitor . . . ///////////////////////////////////////////

However, I have the console opened in administrator mode. And, now I'm trying to compile the examples, it seems VS isn't linking with glew32.lib, because it reports multiple undefined linking symbols relating to gl calls and glew calls, such as glewInit() and glColor().

matus-chochlik commented 10 years ago

Hmm, I'll have to install SDL on one of my windows machines and debug this. Thanks for the feedback so far.

SuperFXMaster commented 10 years ago

I've got a Linux (Ubuntu Trusty Tahr) machine available, and now when I run the python configure script it seems strict version detection still doesn't work, even though I've disabled it. Note now I use GLFW and GLEW.

I have run:

$ cd oglplus-0.46.0
$ sudo python configure.py --from-scratch --use-glew --use-glfw --screenshots
# (...) State output
-- Using GLFW for GL context initialization.
-- Using GLEW as GL API library
-- Detecting OpenGL version
Could not detect GL version, assuming 3.0 # Even though my video card has OpenGL 4.4 and its drivers are properly installed
# (...) Extension checks (They work properly)
CMake Warning at config/OGLplusLib.cmake:63 (message):
  OGLplus library cannot be built!
Call Stack (most recent call first):
  CMakeLists.txt:183 (include)

# (...) More output

My video card has support for OpenGL 4.4 and its drivers are properly installed. See:

$ glewinfo
# (...) Output
GLEW version 1.10.0
Reporting capabilities of display :0, visual 0x6d
Running on a GeForce GT 740M/PCIe/SSE2 from NVIDIA Corporation
OpenGL version 4.4.0 NVIDIA 331.38 is supported
# (...) More output

The strict OpenGL version detection doesn't work. Being aware of that, I've tried:

$ sudo python configure.py --from-scratch --use-glew --use-glfw --screenshots
--strict-gl-version-detection False --max-gl-version 4.4

But nothing changes. The configure script still runs strict version detection. Because of that, the library and the examples cannot be built.

How would I manage to fix that? Is that only happening on my machine?

matus-chochlik commented 10 years ago

This is strange, I've tested the release on 14.04 with the same driver, GLFW and GLEW and it built OK. The only situation when I get this kind of error is when the config uses Mesa's libGL instead of nVidia's. Could you try the following?

Run ./configure.py --from-scratch --no-docs --use-glew --use-glfw --debug-config --debug-gl-ver-error

This will cause the config to abort when it fails to detect GL. Then go to the ./_build/gl directory. There (or in a subdirectory) you will find a Makefile. Run make and have a look at the output or even better paste it here or on pastebin.com

SuperFXMaster commented 10 years ago

I can't guess the problem by looking at it, but hope this helps finding it out. Here it is, note I had to go to _build/gl/CMakeFiles/CMakeTmp to find it, and to sudo for it to be able to write some files.

matus-chochlik commented 10 years ago

OK, thanks for the feedback. From the output is seems that the test file built without problems (it is strange though that you have to use sudo). This means that the compiled binary fails to execute properly for some reason.

Could you execute the compiled file? If you did not delete the _build/ dir then from the output above it should be _build/gl/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec2059085815 and let me know what is the output ?

TIA

SuperFXMaster commented 10 years ago

OK,

Inconsistency detected by ld.so: dl-version.c: 224:
_dl_check_map_versions: Assertion `needed != ((void *)0)' failed!
matus-chochlik commented 10 years ago

OK, this looks like this bug: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-319/+bug/1248642

Try to do the following:

Run locate libGL.so and find the one from the nVidia driver. Remember the directory where it's located (on one of my machines its /usr/lib/nvidia-319-updates) and run:

    export LD_LIBRARY_PATH=/path/to/nvidia-xyz
     ./configure.py --from-scratch --no-docs --use-glew --use-glfw

if that does not work, you could try:

    export LDFLAGS=-lpthread
     ./configure.py --from-scratch --no-docs --use-glew --use-glfw

HTH

SuperFXMaster commented 10 years ago

Hmmm, still not functioning, it seems when config finds GLEW, it finds the libGL.so from /usr/lib/x86-x64-linux-gnu, even if I set the env., look:

-- Found GLEW: /usr/include/GL;/usr/include/libdrm /usr/lib/x86_64-linux-gnu/libGLEW.so;
/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/x86_64-linux-gnu/libGL.so

I think that lib path is not proper, but how to overwrite it?

SuperFXMaster commented 10 years ago

Problem solved by now, my /usr/lib/x86_64-linux-gnu/libGL.so was targeting the Mesa driver, /usr/lib/x86_64-linux-gnu/mesa/libGL.so, so I did:

$ cd /usr/lib/x86_64-linux-gnu
$ sudo rm libGL.so
$ sudo ln -s /usr/lib/nvidia-331/libGL.so /usr/lib/x86_64-linux-gnu/libGL.so

And everything worked correctly. The config now shows -- Found GL version 4.4. TNX, helped a lot! ^_^

EDIT: Just a suggestion, but about the oglplus::BezierCurves class (that's a great one for me), I think it would be very useful to be able to calculate the derivative bezier curve of one given, don't you?

matus-chochlik commented 10 years ago

Glad to hear it works now, but be aware that an update of Mesa is very likely to overwrite your changed symlink. I've several Linux machines with both Mesa and the nVidia driver and the approach with temporarily setting LD_LIBRARY_PATH before running configure works more reliably.

And, I'll add the change to the TODO list, do you have any specific interface in mind ?

SuperFXMaster commented 10 years ago

Just a method of BezierCurves called Derivate, returning a reference to the lower-order, calculated curve, and an overload returning just the control points of the base curve. It calculates the derivative of this class. Like:

//< Create cubic curve
std::vector<Vec2f> cubicPoints{/*(...)*/};
BezierCurves<Vec2f, float, 3> cubicCurve(basePoints);
//< Derivate cubic curve to get another one
BezierCurves<Vec2f, float, 2> derivativeCurve = cubicCurve.Derivate();
//< Approximate derivative curve
std::vector<Vec2f> derivativeApprox;
cubicCurve.Derivate().Approximate(derivativeApprox, 100);
//< (...) Use derivativeApprox for something

//< And...

//< Derivate cubicCurve and store result control points in vector
std::vector<Vec2f> derivatedPoints;
cubicCurve.Derivate(derivatedPoints);
//< (...) Do something with derivatedPoints

See what I mean?

matus-chochlik commented 10 years ago

I've been looking into this and there is one problem: The BezierCurves class assumes that if there are multiple bezier 'segments' (individual curves of a particular order), then the end of the (n-1)-th segment is also the beginning of the n-th segment, i.e. the segments are connected and share their end points. But in the derivative of such sequence of curves the end points are shared only if the original curves are connected smoothly: If the derivative at the end of the (n-1)-th segment is different than the derivative at the beginning at the n-th segment then such sequence cannot be currently stored in the BezierCurves class. So either the BezierCurves class must be reimplemented to store (sometimes) duplicate points or the Derivative() function will be available only in the CubicBezierLoop class (the latter is not probably what you want).

matus-chochlik commented 10 years ago

OK, I've updated the BezierCurves class to be able to handle both connected and disconnected sequences of bezier curves and added the Detivative() function. See the develop branch.