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

Author Topic: xcode and SFML template  (Read 294 times)

0 Members and 1 Guest are viewing this topic.

abp54

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
xcode and SFML template
« on: December 27, 2023, 01:01:50 am »
I have been trying to get the SFML supplied template to work in Xcode for days.

ld: Undefined symbols:
  sf::WindowBase::setIcon(unsigned int, unsigned int, unsigned char const*), referenced from:
      _main in main.o
  sf::WindowBase::pollEvent(sf::Event&), referenced from:
      _main in main.o
  sf::WindowBase::isOpen() const, referenced from:
      _main in main.o

So obviously the linker can't find these SFML functions.
Next thing I did was go to build phases and manually put the libraries in Link Binary with libraries.
That solved the undefined symbols but ...

but now at runtime the executable can't find the libraries i.e

Users/Anthony/Library/Developer/Xcode/DerivedData/Clock-hbdspgdobmwublfsselddugcryzd/Build/Products/Debug/Clock.app/Contents/MacOS/../Frameworks/sfml-system.framework/Versions/2.5.1/sfml-system' (no such file)

I am on xcode 15.1

Any help would be appreciated

I am able to compile and run my SFML app in VSCode without any issues. I am trying to use xcode hoping it would make an app bundle for me.

I also compiled and ran the app from the command line without any issue.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10827
    • View Profile
    • development blog
    • Email
Re: xcode and SFML template
« Reply #1 on: December 30, 2023, 12:43:35 pm »
Sounds like you're getting some old installation of SFML.
WindowBase was introduced in SFML 2.6, but your path still lists SFML 2.5.1.
Make sure you delete old files.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything