ViZDoom
ViZDoom copied to clipboard
problems with sdl compilation on Mac OS
Why I try to compile with cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON=ON -DBUILD_JAVA=ON -DBUILD_LUA=ON
and make
I get a lot of SDL errors. The first error is:
In file included from ./ViZDoom/src/vizdoom/src/oplsynth/music_opldumper_mididevice.cpp:37: In file included from ./ViZDoom/src/vizdoom/src/sound/i_musicinterns.h:20: In file included from ./ViZDoom/src/vizdoom/src/oplsynth/opl_mus_player.h:1: In file included from ./ViZDoom/src/vizdoom/src/posix/sdl/critsec.h:9: In file included from /Library/Frameworks/SDL.framework/Headers/SDL_thread.h:32: /Library/Frameworks/SDL.framework/Headers/SDL_stdinc.h:94:2: error: redefinition of enumerator 'SDL_FALSE' SDL_FALSE = 0, ^ /usr/local/include/SDL2/SDL_stdinc.h:141:5: note: previous definition is here SDL_FALSE = 0,
Then a list of similar errors follow. I tried adding SLD with brew install SDL
but the error persists. SDL2 is installed.
Hi @BSVogler,
you should install SDL2 package (brew install SDL2
), SDL is the first version and it is available as separate package in brew.
@nwydmuch You probably did not saw my edit. I have sdl2 installed.
It seems that you have two versions of SDL2 in your system that conflict. One in /Library/Frameworks/SDL.framework/Headers/SDL_stdinc.h and other in /usr/local/include/SDL2/SDL_stdinc.h (from brew). You should remove one.
You were right. I uninstalled the brew one. make
says that it found the one in /Library/Frameworks/SDL.framework
However I am still getting the same error. :(
- Are you still getting this message: ?
/Library/Frameworks/SDL.framework/Headers/SDL_stdinc.h:94:2: error: redefinition of enumerator 'SDL_FALSE'
SDL_FALSE = 0,
^
/usr/local/include/SDL2/SDL_stdinc.h:141:5: note: previous definition is here
SDL_FALSE = 0,
-
Are you sure that you removed SLD2 from brew?
-
Is this working for you: ?
sdl2-config
sdl2-config --version
- Did you rerun:
rm CMakeCache.txt
cmake -DCMAKE_BUILD_TYPE=Release ...
make
I can confirm every point but this one: There is not such command as sdl2-config
on my system. After all it's just a framework in the frameworks folder.
SDL2 should have sdl2-config app that provides information for building. But it is strange that you are still getting same error. Did you check if files were really removed from /usr/local/include/SDL2/
? You can try to edit cmake_modules/FindSDL2.cmake
and remove all searching paths and left only /Library/Frameworks/
. Also I suggest to remove all SDL versions and install only one from brew.
I found a solution. The problem is that /Library/Frameworks/SDL.framework
version 1 is being used even if cmake says it found the installed SDL2 version. Can this be caused because "sdl.h" is used in vizdoom? Is there something like "sdl2.h?"
No, SDL2 doesn't use '2' in its headers, sdl.h is correct include for SDL2.
Old issue, closing.