Hi!
On OS X sdl2 doesn’t link for me, although I have sdl2 installed with homebrew. Any help would be appreciated.
cmake:
laptop% cmake -G Xcode .. -DENABLE_LAUNCHER=OFF
-- The C compiler identification is AppleClang 6.0.0.6000051
-- The CXX compiler identification is AppleClang 6.0.0.6000051
CMake Warning at /usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/Platform/Darwin.cmake:179 (message):
Ignoring CMAKE_OSX_SYSROOT value:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
because the directory does not exist.
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.0.2/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
CMakeLists.txt:1 (project)
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Xcode
-- Check for working CXX compiler using: Xcode -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for shm_open in rt
-- Looking for shm_open in rt - not found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Boost version: 1.51.0
-- Found the following Boost libraries:
-- filesystem
-- locale
-- program_options
-- system
-- thread
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.5")
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.28")
-- checking for module 'libavcodec'
-- found libavcodec, version 56.1.100
-- checking for module 'libavformat'
-- found libavformat, version 56.4.101
-- checking for module 'libavdevice'
-- found libavdevice, version 56.0.100
-- checking for module 'libavutil'
-- found libavutil, version 54.7.100
-- checking for module 'libswscale'
-- found libswscale, version 3.0.100
-- checking for module 'libpostproc'
-- found libpostproc, version 53.0.100
-- Found FFmpeg: /Volumes/kuglee/vcmi/lib/libavcodec.a;/Volumes/kuglee/vcmi/lib/libavformat.a;/Volumes/kuglee/vcmi/lib/libavutil.a;/Volumes/kuglee/vcmi/lib/libswscale.a;-framework VideoDecodeAcceleration -framework CoreVideo -lbz2
-- checking for module 'minizip'
-- found minizip, version 1.2.8
-- Found MINIZIP: /usr/local/Cellar/minizip/1.1/lib/libminizip.dylib (found version "1.2.8")
-- checking for module 'sdl2'
-- found sdl2, version 2.0.3
-- Found SDL2: /usr/local/lib/libSDL2.dylib;-framework Cocoa (found version "2.0.3")
-- checking for module 'SDL2_image'
-- found SDL2_image, version 2.0.0
-- Found SDL2_image: /usr/local/lib/libSDL2_image.dylib (found version "2.0.0")
-- checking for module 'SDL2_mixer'
-- found SDL2_mixer, version 2.0.0
-- Found SDL2_mixer: /usr/local/lib/libSDL2_mixer.dylib
-- checking for module 'SDL2_ttf'
-- found SDL2_ttf, version 2.0.12
-- Found SDL2_ttf: /usr/local/lib/libSDL2_ttf.dylib (found version "2.0.12")
-- cotire 1.6.6 loaded.
-- CXX target vcmi cotired without unity build.
-- C CXX target vcmiclient cotired without unity build and precompiled header. Exclusion of source files not supported for generator Xcode.
-- CXX target vcmiserver cotired without unity build.
-- CXX target BattleAI cotired without unity build.
-- CXX target StupidAI cotired without unity build.
-- CXX target VCAI cotired without unity build.
-- Configuring done
CMake Warning (dev) at client/CMakeLists.txt:79 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "minizip" of target "vcmiclient" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
BattleAI
EmptyAI
StupidAI
VCAI
vcmi
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /Volumes/kuglee/vcmi/vcmi/build
error:
Undefined symbols for architecture x86_64:
"_SDL_CreateYUVOverlay", referenced from:
CVideoPlayer::open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, bool, bool) in CVideoHandler.o
"_SDL_DisplayYUVOverlay", referenced from:
CVideoPlayer::playVideo(int, int, SDL_Surface*, bool) in CVideoHandler.o
"_SDL_EnableKeyRepeat", referenced from:
setScreenRes(int, int, int, bool, bool) in CMT.o
"_SDL_EnableUNICODE", referenced from:
setScreenRes(int, int, int, bool, bool) in CMT.o
"_SDL_FreeYUVOverlay", referenced from:
CVideoPlayer::close() in CVideoHandler.o
"_SDL_GetKeyState", referenced from:
isShiftKeyDown() in CPlayerInterface.o
isAltKeyDown() in CPlayerInterface.o
isCtrlKeyDown() in CPlayerInterface.o
isCtrlKeyDown() in CAdvmapInterface.o
"_SDL_LockYUVOverlay", referenced from:
CVideoPlayer::nextFrame() in CVideoHandler.o
"_SDL_SetAlpha", referenced from:
CPicture::setAlpha(int) in Images.o
"_SDL_SetColors", referenced from:
Graphics::blueToPlayersAdv(SDL_Surface*, PlayerColor) in Graphics.o
SDLImageLoader::init(Point, Point, Point, SDL_Color*) in CAnimation.o
CSDL_Ext::setPlayerColor(SDL_Surface*, PlayerColor) in SDL_Extensions.o
shiftColors(SDL_Surface*, int, int) in mapHandler.o
CBuildingRect::show(SDL_Surface*) in CCastleInterface.o
"_SDL_SetVideoMode", referenced from:
setScreenRes(int, int, int, bool, bool) in CMT.o
fullScreenChanged() in CMT.o
"_SDL_UnlockYUVOverlay", referenced from:
CVideoPlayer::nextFrame() in CVideoHandler.o
"_SDL_UpdateRect", referenced from:
CVideoPlayer::show(int, int, SDL_Surface*, bool) in CVideoHandler.o
CSDL_Ext::update(SDL_Surface*) in SDL_Extensions.o
"_SDL_VideoModeOK", referenced from:
setScreenRes(int, int, int, bool, bool) in CMT.o
fullScreenChanged() in CMT.o
"_SDL_WM_SetCaption", referenced from:
setScreenRes(int, int, int, bool, bool) in CMT.o
"_SDL_WarpMouse", referenced from:
CCursorHandler::centerCursor() in CCursorHandler.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)