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

Author Topic: Setup - Xcode 13 - macOS Monterey  (Read 979 times)

0 Members and 1 Guest are viewing this topic.

wnperes

  • Newbie
  • *
  • Posts: 3
    • View Profile
Setup - Xcode 13 - macOS Monterey
« on: January 11, 2022, 10:46:44 am »
Trying to setup on Xcode 13 M1 chip - macOS Monterey

Installed with Brew - added Library and Header directiory to project - Xcode finds the files and color codes objects etc.

When trying to compile a very simple statement as below:
-------------
#include <Graphics.hpp>
using namespace sf;
int main(int argc, const char * argv[]) {
    RenderWindow window(sf::VideoMode(800, 600), "SFML window"); 
    return 0;}
--------------
I get the following error message:

Undefined symbol: sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)
Undefined symbol: sf::RenderWindow::~RenderWindow()
Undefined symbol: sf::String::String(char const*, std::__1::locale const&)
Undefined symbol: sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)

I must be missing something very simple - any suggestions?...

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10149
    • View Profile
    • development blog
    • Email
Re: Setup - Xcode 13 - macOS Monterey
« Reply #1 on: January 11, 2022, 11:29:25 am »
The correct include header path would be <SFML/Graphics.hpp>.

You need to also link SFML and not just point to the library directory.
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/

wnperes

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Setup - Xcode 13 - macOS Monterey
« Reply #2 on: January 11, 2022, 01:30:27 pm »
yes my bad - after linking I now get another message related to x86_64 vs arm 64 as below:

ld: warning: ignoring file /opt/homebrew/Cellar/sfml/2.5.1_1/lib/libsfml-network.2.5.1.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/Cellar/sfml/2.5.1_1/lib/libsfml-system.2.5.1.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/Cellar/sfml/2.5.1_1/lib/libsfml-audio.2.5.1.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/Cellar/sfml/2.5.1_1/lib/libsfml-window.2.5.1.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

wnperes

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Setup - Xcode 13 - macOS Monterey
« Reply #3 on: January 11, 2022, 01:34:09 pm »
and yes I realize that it seems to be an issue where Homebrew downloaded an x86 compile - I am just checking if this is indeed the issue and I need to compile from source in arm - if there are any workarounds for this or someone has a distribution for arm64

 

anything