SFML community forums

Help => General => Topic started by: Zsivony1es on October 18, 2021, 09:45:43 am

Title: ld:library not found for -lSFML
Post by: Zsivony1es on October 18, 2021, 09:45:43 am
Hi everyone!
After trying to build my SFML project with CMake on MacOS, I get this error at the linking process:

ld: library not found for -lSFML
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [app/SortingAlgo] Error 1
make[1]: *** [app/CMakeFiles/SortingAlgo.dir/all] Error 2
make: *** [all] Error 2

I have GitHub repository made for the project: https://github.com/Zsivony1es/SortingAlgo.git
Is there a quick fix for this?
Thanks for any replies in advance!
Title: Re: ld:library not found for -lSFML
Post by: eXpl0it3r on October 18, 2021, 01:45:00 pm
The quick fix is to learn how CMake works and what target exist instead of just guessing and adding SFML as linking target. ;)

You can find the different CMake targets listed here: https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php#building-sfml
And here's an example CMake file: https://en.sfml-dev.org/forums/index.php?topic=24070.0