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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - abp54

Pages: [1]
1
General discussions / 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.

2
General / SFML xcode template does not work
« on: December 25, 2023, 12:40:40 am »
Followed the directions exactly from sfml to run an xcode sfml app
https://www.sfml-dev.org/tutorials/2.6/start-osx.php

error:
Command PhaseScriptExecution failed with a nonzero exit code

I had this running in vscode in 20 minutes. xcode seems like overkill.
Sorry just bugged.

3
General / Re: [SOLVED] Xcode, SFML error dyld: Library not loaded
« on: December 25, 2023, 12:10:45 am »
solved? how?

4
General / Re: VS Code running simple sfml app macos
« on: December 10, 2023, 08:55:41 pm »
Found it!!!

On systems where you use libX.a (or libX.so, or libX.dylib like on macOS) libraries, the name of the library is X.

You should not include the lib prefix or the suffix (.a or .so or .dylib). Those are added by the linker automatically when searching for the library.

The name of the sfml-graphics.2.5.1 library is just that, and it's the name you should use: -lsfml-graphics.2.5.1

Live and learn.
Thanks

5
General / Re: VS Code running simple sfml app macos
« on: December 10, 2023, 08:36:49 pm »
Thank you for the reply. This is the actual command.

g++ -o app -I/usr/local/opt/sfml/include -L/usr/local/opt/sfml/lib -llibsfml-graphics.2.6.1.dylib -llibsfml-window.2.6.1.dylib -llibsfml-system.2.6.1.dylib

result:
ld: library 'libsfml-graphics.2.6.1.dylib' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)

And from my project folder

[Anthony@:~/projects/abp]$ ls /usr/local/opt/sfml/lib
cmake                        libsfml-audio.dylib          libsfml-graphics.dylib       libsfml-network.dylib        libsfml-system.dylib         libsfml-window.dylib
libsfml-audio.2.6.1.dylib    libsfml-graphics.2.6.1.dylib libsfml-network.2.6.1.dylib  libsfml-system.2.6.1.dylib   libsfml-window.2.6.1.dylib   pkgconfig
libsfml-audio.2.6.dylib      libsfml-graphics.2.6.dylib   libsfml-network.2.6.dylib    libsfml-system.2.6.dylib     libsfml-window.2.6.dylib

The path is correct and the libraries are there. Can't for the life of me see why compiler tells me they are not found.

And the full invocation:
[Anthony@:~/projects/abp]$ g++ -v -o app -I/usr/local/opt/sfml/include -L/usr/local/opt/sfml/lib -llibsfml-graphics.2.6.1.dylib -llibsfml-window.2.6.1.dylib -llibsfml-system.2.6.1.dylib
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 13.0.0 14.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o app -L/usr/local/opt/sfml/lib -L/usr/local/lib -llibsfml-graphics.2.6.1.dylib -llibsfml-window.2.6.1.dylib -llibsfml-system.2.6.1.dylib -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/libclang_rt.osx.a
ld: library 'libsfml-graphics.2.6.1.dylib' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Regards



6
General / Re: VS Code running simple sfml app macos
« on: December 10, 2023, 12:04:21 am »
What I really would like to know is what are the required libraries to link with macos g++.
It seems to me that:

g++ main.cpp -o appname -I<path to includes> -L<path to libraries> should work. I have seen it work in several tutorials. I just get path not found and I have done ls on the path and it is correct. Is it something to do with the .dylib extension. Does g++ appending something to the file name.
 
How do the Framework versions differ?

I would not reach out but I have been thru every tutorial I could find and everyone of them fail.
Maybe my mac is corrupted or I am just really missing something.

7
General / VS Code running simple sfml app macos
« on: December 09, 2023, 01:10:38 am »
I have downloaded sfml and installed the libraries and include files in my project folder. I built task.json file and all is good. All the libraries and include files are found. It builds just fine but will not link with the following error:

dyld[26832]: Symbol not found: __ZN2sf6StringC1EPKcRKNSt3__16localeE
  Referenced from: <9D94329C-AD52-32F9-8EC3-F5817B408DDC> /Users/Anthony/projects/sfmltest/app
  Expected in:     <no uuid> un

Anyone else run into this. I can't seem to figure it out. I am new to sfml and a bit rusty on my c so any help would be appreciated.

Pages: [1]