SFML submodule breaks build
koutoftimer opened this issue · comments
It feels like you have SFML submodule linked to master branch, which is not stable as it intended to be generally.
/tmp $ git clone https://github.com/tizian/Cendric2.git --recurse-submodules --recursive
Cloning into 'Cendric2'...
remote: Enumerating objects: 54474, done.
remote: Counting objects: 100% (109/109), done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 54474 (delta 9), reused 92 (delta 6), pack-reused 54365
Receiving objects: 100% (54474/54474), 863.98 MiB | 3.89 MiB/s, done.
Resolving deltas: 100% (43133/43133), done.
Updating files: 100% (2847/2847), done.
Submodule 'ext/sfml' (https://github.com/sfml/sfml.git) registered for path 'ext/sfml'
Cloning into '/tmp/Cendric2/ext/sfml'...
remote: Enumerating objects: 32729, done.
remote: Counting objects: 100% (628/628), done.
remote: Compressing objects: 100% (316/316), done.
remote: Total 32729 (delta 320), reused 455 (delta 247), pack-reused 32101
Receiving objects: 100% (32729/32729), 91.08 MiB | 4.00 MiB/s, done.
Resolving deltas: 100% (22946/22946), done.
Submodule path 'ext/sfml': checked out '4a41f37d5d0c8b3be91205f3e4e21671a7cf3f63'
/tmp $ cd Cendric2/
/tmp/Cendric2 $ mkdir build
/tmp/Cendric2 $ cd build/
/tmp/Cendric2/build $ cmake ..
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:315 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
FindOpenGL found both a legacy GL library:
OPENGL_gl_LIBRARY: /usr/lib64/libGL.so
and GLVND libraries for OpenGL and GLX:
OPENGL_opengl_LIBRARY: /usr/lib64/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib64/libGLX.so
OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
ext/sfml/cmake/Macros.cmake:274 (find_package)
ext/sfml/src/SFML/Window/CMakeLists.txt:245 (sfml_find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found OpenGL: /usr/lib64/libOpenGL.so
-- libudev stable: 1
-- Found UDev: /usr/lib64/libudev.so
-- include: /usr/include
-- Found OpenAL: /usr/lib64/libopenal.so
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (VORBIS)
does not match the name of the calling package (Vorbis). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
ext/sfml/cmake/Modules/FindVorbis.cmake:25 (find_package_handle_standard_args)
ext/sfml/cmake/Macros.cmake:274 (find_package)
ext/sfml/src/SFML/Audio/CMakeLists.txt:70 (sfml_find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found VORBIS: /usr/lib64/libvorbisenc.so;/usr/lib64/libvorbisfile.so;/usr/lib64/libvorbis.so;/usr/lib64/libogg.so
-- Found FLAC: /usr/lib64/libFLAC.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- Performing Test HAS_CPP11_FLAG
-- Performing Test HAS_CPP11_FLAG - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.4")
-- Checking for one of the modules 'OPTIONAL;gamerzilla'
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/Cendric2/build
/tmp/Cendric2/build $ cmake --build . -- -j2
[ 0%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Err.cpp.o
[ 1%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.o
[ 1%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Lock.cpp.o
[ 1%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Mutex.cpp.o
[ 1%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Sleep.cpp.o
[ 2%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/String.cpp.o
[ 2%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Thread.cpp.o
[ 2%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/ThreadLocal.cpp.o
[ 2%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Time.cpp.o
[ 2%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/FileInputStream.cpp.o
[ 2%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/MemoryInputStream.cpp.o
[ 3%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Unix/ClockImpl.cpp.o
[ 3%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Unix/MutexImpl.cpp.o
[ 3%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Unix/SleepImpl.cpp.o
[ 3%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Unix/ThreadImpl.cpp.o
[ 3%] Building CXX object ext/sfml/src/SFML/System/CMakeFiles/sfml-system.dir/Unix/ThreadLocalImpl.cpp.o
[ 4%] Linking CXX shared library ../../../lib/libsfml-system.so
[ 4%] Built target sfml-system
[ 4%] Building CXX object ext/sfml/src/SFML/Window/CMakeFiles/sfml-window.dir/Clipboard.cpp.o
[ 5%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/ALCheck.cpp.o
[ 5%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/AlResource.cpp.o
[ 5%] Building CXX object ext/sfml/src/SFML/Window/CMakeFiles/sfml-window.dir/Context.cpp.o
[ 5%] Building CXX object ext/sfml/src/SFML/Window/CMakeFiles/sfml-window.dir/Cursor.cpp.o
[ 5%] Building CXX object ext/sfml/src/SFML/Window/CMakeFiles/sfml-window.dir/GlContext.cpp.o
[ 5%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o
In file included from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:123:3: error: conflicting declaration ‘typedef struct GLXHyperpipeNetworkSGIX GLXHyperpipeNetworkSGIX’
123 | } GLXHyperpipeNetworkSGIX;
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/glx.h:333,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:36,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/usr/include/GL/glxext.h:771:3: note: previous declaration as ‘typedef struct GLXHyperpipeNetworkSGIX GLXHyperpipeNetworkSGIX’
771 | } GLXHyperpipeNetworkSGIX;
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:129:3: error: conflicting declaration ‘typedef struct GLXHyperpipeConfigSGIX GLXHyperpipeConfigSGIX’
129 | } GLXHyperpipeConfigSGIX;
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/glx.h:333,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:36,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/usr/include/GL/glxext.h:777:3: note: previous declaration as ‘typedef struct GLXHyperpipeConfigSGIX GLXHyperpipeConfigSGIX’
777 | } GLXHyperpipeConfigSGIX;
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:134:3: error: conflicting declaration ‘typedef struct GLXPipeRect GLXPipeRect’
134 | } GLXPipeRect;
| ^~~~~~~~~~~
In file included from /usr/include/GL/glx.h:333,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:36,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/usr/include/GL/glxext.h:782:3: note: previous declaration as ‘typedef struct GLXPipeRect GLXPipeRect’
782 | } GLXPipeRect;
| ^~~~~~~~~~~
In file included from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:138:3: error: conflicting declaration ‘typedef struct GLXPipeRectLimits GLXPipeRectLimits’
138 | } GLXPipeRectLimits;
| ^~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/glx.h:333,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:36,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/usr/include/GL/glxext.h:786:3: note: previous declaration as ‘typedef struct GLXPipeRectLimits GLXPipeRectLimits’
786 | } GLXPipeRectLimits;
| ^~~~~~~~~~~~~~~~~
/tmp/Cendric2/ext/sfml/src/SFML/Audio/AudioDevice.cpp: In static member function ‘static bool sf::priv::AudioDevice::isExtensionSupported(const string&)’:
/tmp/Cendric2/ext/sfml/src/SFML/Audio/AudioDevice.cpp:110:10: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
110 | std::auto_ptr<AudioDevice> device;
| ^~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include/g++-v10/memory:83,
from /tmp/Cendric2/ext/sfml/src/SFML/Audio/AudioDevice.cpp:32:
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include/g++-v10/bits/unique_ptr.h:57:28: note: declared here
57 | template<typename> class auto_ptr;
| ^~~~~~~~
/tmp/Cendric2/ext/sfml/src/SFML/Audio/AudioDevice.cpp: In static member function ‘static int sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int)’:
/tmp/Cendric2/ext/sfml/src/SFML/Audio/AudioDevice.cpp:128:10: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
128 | std::auto_ptr<AudioDevice> device;
| ^~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include/g++-v10/memory:83,
from /tmp/Cendric2/ext/sfml/src/SFML/Audio/AudioDevice.cpp:32:
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/include/g++-v10/bits/unique_ptr.h:57:28: note: declared here
57 | template<typename> class auto_ptr;
| ^~~~~~~~
gmake[2]: *** [ext/sfml/src/SFML/Window/CMakeFiles/sfml-window.dir/build.make:118: ext/sfml/src/SFML/Window/CMakeFiles/sfml-window.dir/GlContext.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:256: ext/sfml/src/SFML/Window/CMakeFiles/sfml-window.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 5%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/Listener.cpp.o
[ 5%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/Music.cpp.o
[ 5%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/Sound.cpp.o
[ 6%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundBuffer.cpp.o
[ 6%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundBufferRecorder.cpp.o
[ 6%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/InputSoundFile.cpp.o
[ 6%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/OutputSoundFile.cpp.o
[ 6%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o
[ 7%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundSource.cpp.o
[ 7%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundStream.cpp.o
[ 7%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundFileFactory.cpp.o
[ 7%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundFileReaderFlac.cpp.o
[ 7%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundFileReaderOgg.cpp.o
[ 8%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundFileReaderWav.cpp.o
[ 8%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundFileWriterFlac.cpp.o
[ 8%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundFileWriterOgg.cpp.o
[ 8%] Building CXX object ext/sfml/src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundFileWriterWav.cpp.o
[ 8%] Linking CXX shared library ../../../lib/libsfml-audio.so
[ 8%] Built target sfml-audio
gmake: *** [Makefile:136: all] Error 2
From the log it looks like this correctly checked out 4a41f37
, which is a specific SFML commit from 3 years ago? I suspect the issue here lies elsewhere.
CC @Ironbell
Also, the SFML master branch is very stable in general 😉
In file included from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:123:3: error: conflicting declaration ‘typedef struct GLXHyperpipeNetworkSGIX GLXHyperpipeNetworkSGIX’
123 | } GLXHyperpipeNetworkSGIX;
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/glx.h:333,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxExtensions.hpp:36,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/Unix/GlxContext.hpp:32,
from /tmp/Cendric2/ext/sfml/src/SFML/Window/GlContext.cpp:54:
/usr/include/GL/glxext.h:771:3: note: previous declaration as ‘typedef struct GLXHyperpipeNetworkSGIX GLXHyperpipeNetworkSGIX’
771 | } GLXHyperpipeNetworkSGIX;
| ^~~~~~~~~~~~~~~~~~~~~~~
Can it be that new version of glxext.h
already contains declarations that leads to an error? The only package on my system that could have installed it is mesa: media-libs/mesa-21.1.7::gentoo
Mesa 21.1.7 Release Notes / 2021-08-11
Also I have found literally the same issue in SFML's issues SFML/SFML#1472
Which was fixed in SFML/SFML@87aaa9e
If you take the master branch, things should work fine
@eXpl0it3r about updating to new sfml, I did it with
/tmp/Cendric2/ext/sfml $ git checkout master
Previous HEAD position was 4a41f37d Fixed stale FBOs not being erased from the staleFramebuffers set after they have been deleted.
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
right after cloning and it worked, but:
- it is not mentioned in README
- I do belive there is a way to move "pointer" to commit/branch of SFML to pull during git clone in .gtimodules
The issue is only very recent (in comparison to the latest changes on here) and only on certain Linux distros, so it's not surprising that such workarounds aren't mentioned anywhere.
Additionally, Cendric was developed against a certain version of SFML, so while an upgrade should work out of the box, it needs to be tested, thus it's still pointing to an older version.
Whether and how SFML should be updated is something for a maintainer to decide.
It may not be intentional, but your writing comes across very demanding 😉
Great to hear that updating the submodule manually worked out!