g++ setting proper @rpath when building SFML
1
vote
0
answers
83
views
I'm trying to build an SFML sample without xcode (for reasons :-)).
The prebuilt samples comes with:
pong> otool -L pong
pong:
@rpath/sfml-audio.framework/Versions/2.5.1/sfml-audio (compatibility version 2.5.0, current version 2.5.1)
@rpath/sfml-graphics.framework/Versions/2.5.1/sfml-graphics (compatibility version 2.5.0, current version 2.5.1)
@rpath/sfml-window.framework/Versions/2.5.1/sfml-window (compatibility version 2.5.0, current version 2.5.1)
@rpath/sfml-system.framework/Versions/2.5.1/sfml-system (compatibility version 2.5.0, current version 2.5.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 19.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
When I build it myself (build command follows), I rather obtain:
pong> otool -L a.out
a.out:
@rpath/libsfml-system.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
@rpath/libsfml-window.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
@rpath/libsfml-graphics.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
@rpath/libsfml-audio.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
This prevents my built version from running, as it fails to load the library. How would I tell g++
to generate the same @rpath
s as those prebuilt?
The build command I used is:
g++ Pong.cpp -I ../../include -L ../../lib/ -lsfml-system -lsfml-window -lsfml-graphics -lsfml-audio
In case this makes any difference, this is on Ventura.
Asked by Jeffrey
(111 rep)
Mar 25, 2023, 06:49 PM
Last activity: Mar 25, 2023, 08:33 PM
Last activity: Mar 25, 2023, 08:33 PM