SFML community forums
Help => General => Topic started by: Evan Bowman on November 08, 2016, 10:09:07 pm
-
I have a project that uses CMake, builds fine in macOS and Linux, but I'm having trouble getting it set up in windows (minGW)
The error I'm getting is this:
CMake Error at cmake_modules/FindSFML.cmake:355 (message):
SFML found but some of its dependencies are missing ( FreeType libjpeg
OpenAL Ogg Vorbis VorbisFile VorbisEnc FLAC)
Call Stack (most recent call first):
CMakeLists.txt:35 (find_package)
But I can see the dependencies alongside the sfml static libs:
$ ls /c/Program\ Files\ \(x86\)/SFML/lib/
libFLAC.a libsfml-audio.a libsfml-graphics-d.a libsfml-network.a libsfml-system-d.a libsfml-window-s.a
libfreetype.a libsfml-audio-d.a libsfml-graphics-s.a libsfml-network-d.a libsfml-system-s.a libsfml-window-s-d.a
libjpeg.a libsfml-audio-s.a libsfml-graphics-s-d.a libsfml-network-s.a libsfml-system-s-d.a libvorbis.a
libogg.a libsfml-audio-s-d.a libsfml-main.a libsfml-network-s-d.a libsfml-window.a libvorbisenc.a
libopenal32.a libsfml-graphics.a libsfml-main-d.a libsfml-system.a libsfml-window-d.a libvorbisfile.a
From reading other forum posts, it looks like SFML needs to be linked statically in Windows, I am doing that:
set(SFML_STATIC_LIBRARIES ON)
find_package(SFML 2.4 REQUIRED graphics window network audio system)
For reference, here's the complete CMakeLists file that I'm using: https://github.com/evanbowman/blind-jump/blob/development/build/CMakeLists.txt
-
I get this too when trying to link statically, maybe it's some configuration that need to be done;
But you're not restricted to link statically on Windows, you can link it with shared libs too.
-
You don't "have to" link statically on Windows. ;)
How should CMake know where to look for the SFML libraries? On Windows there's no real predefined place to place libraries. As such you simply need to specify a path to the root directory of SFML with SFML_ROOT.
-
Thanks for both of your responses!
I'm still getting used to working without a centralized lib folder, I guess I've been spoiled by apt/rpm/homebrew :)