#Setting rpath correctly

1 messages · Page 1 of 1 (latest)

onyx tartan
#

I'm struggling to find how to do this properly. I have a game binary using raylib built as a shared library. My zig-out looks like the following when I build:

zig-out/
   bin/
      // game_binary
   lib/
      // libraylib.so
   include/
      // headers

when I cd into bin/ and run ./game_binary, I get the error: error while loading shared libraries: libraylib.so: cannot open shared object file: No such file or directory, so I'm thinking I just need to set the rpath correctly. what's the correct way to do this in build.zig?

#

also idk why, but if im in my main repo folder, zig build run runs everything fine. I'm basically trying to troubleshoot as if I'm packaging the game to run on another PC.

strange cloud
#

Strikes me as odd to see headers in build output unless you're creating a reusable library/API to your app.

onyx tartan
#

true, I think that's from the raylib-zig build process. when I create the dependency in my build.zig I set the .linkage to dynamic and that's when lib/ and include/ started being generated.

strange cloud
#

The header shouldn't be needed to load a dylib.