You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And elsewhere I have a cc_binary that depends on @sfml_darwin_arm64//:sfml.
I can build it, but when I run it, it fails with:
dyld[25006]: Library not loaded: '@rpath/../Frameworks/freetype.framework/Versions/A/freetype'
Referenced from: '/private/var/tmp/_bazel_garymm/3e07c6659fb8b409c34beec346d81b7b/external/sfml_darwin_arm64/lib/libsfml-graphics.2.5.1.dylib'
Reason: tried: '/private/var/tmp/_bazel_garymm/3e07c6659fb8b409c34beec346d81b7b/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/src/../_solib_darwin_arm64/_U@sfml_Udarwin_Uarm64_S_S_Cgraphics___Ulib/../Frameworks/freetype.framework/Versions/A/freetype' (no such file), '/private/var/tmp/_bazel_garymm/3e07c6659fb8b409c34beec346d81b7b/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/src/../_solib_darwin_arm64/_U@sfml_Udarwin_Uarm64_S_S_Csystem___Ulib/../Frameworks/freetype.framework/Versions/A/freetype' (no such file), '/private/var/tmp/_bazel_garymm/3e07c6659fb8b409c34beec346d81b7b/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/src/../_solib_darwin_arm64/_U@sfml_Udarwin_Uarm64_S_S_Cwindow___Ulib/../Frameworks/freetype.framework/Versions/A/freetype' (no such file), '/private/var/tmp/_bazel_garymm/3e07c6659fb8b409c34beec346d81b7b/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/src/../_solib_darwin_arm64/_U@sfml_Udarwin_Uarm64_S_S_Cgraphics___Ulib/../Frameworks/freetype.framework/Versions/A/freetype' (no such file), '/private/var/tmp/_bazel_garymm/3e07c6659fb8b409c34beec346d81b7b/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/src/../_solib_darwin_arm64/_U@sfml_Udarwin_Uarm64_S_S_Csystem___Ulib/../Frameworks/freetype.framework/Versions/A/freetype' (no such file), '/private/var/tmp/_bazel_garymm/3e07c6659fb8b409c34beec346d81b7b/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/src/../_solib_darwin_arm64/_U@sfml_Udarwin_Uarm64_S_S_Cwindow___Ulib/../Frameworks/freetype.framework/Versions/A/freetype' (no such file), '/Library/Frameworks/freetype.framework/Versions/A/freetype' (no such file), '/System/Library/Frameworks/freetype.framework/Versions/A/freetype' (no such file)
Some things I've tried:
Adding the framework files to the data of the cc_import. E.g.:
cc_import(
name = "graphics",
shared_library = "lib/libsfml-graphics.2.5.dylib",
data = glob(["lib/freetype.framework/**"]),
)
Keeping "Framework" in the repository prefix rather than putting it into strip_prefix of the http_archive.
Keeping "Library/Framework" rather than putting into strip_prefix of the http_archive
Setting linkopts on the cc_library. E.g. linkopts = ["-Flib", "-framework freetype"]. The linker doesn't see the lib directory.
The SDK also includes frameworks in addition to dylibs, so I also tried apple_dynamic_framework_import instead of cc_import, but that seems to result in the resulting binary not being able to resolve the symbols at all. I also tried routing things through an objc_library before the cc_library.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to use a pre-built SFML SDK like so.
When expanded, the SDK looks like:
The app builds but fails at runtime complaining it can't find the freetype framework:
And elsewhere I have a
cc_binary
that depends on@sfml_darwin_arm64//:sfml
.I can build it, but when I run it, it fails with:
Some things I've tried:
data
of thecc_import
. E.g.:strip_prefix
of thehttp_archive
.strip_prefix
of thehttp_archive
linkopts
on thecc_library
. E.g.linkopts = ["-Flib", "-framework freetype"]
. The linker doesn't see the lib directory.The SDK also includes frameworks in addition to dylibs, so I also tried
apple_dynamic_framework_import
instead ofcc_import
, but that seems to result in the resulting binary not being able to resolve the symbols at all. I also tried routing things through anobjc_library
before thecc_library
.Beta Was this translation helpful? Give feedback.
All reactions