Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: ld:library not found for -lSFML  (Read 2229 times)

0 Members and 1 Guest are viewing this topic.

Zsivony1es

  • Newbie
  • *
  • Posts: 2
    • View Profile
ld:library not found for -lSFML
« 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!
« Last Edit: October 18, 2021, 10:15:27 am by Zsivony1es »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10044
    • View Profile
    • development blog
    • Email
Re: ld:library not found for -lSFML
« Reply #1 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
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

 

anything