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
When I try to build my Odinlang project using nix-build -A package, I get the following errors:
/nix/store/qsx2xqqm0lp6d8hi86r4y0rz5v9m62wn-binutils-2.42/bin/ld: cannot find -l:/nix/store/5kqscq1vk49zpjw5h3gqmnlzb87wfvli-odin-0-unstable-2024-08-05/share/vendor/raylib/linux/libraygui.a: No such file or directory
/nix/store/qsx2xqqm0lp6d8hi86r4y0rz5v9m62wn-binutils-2.42/bin/ld: cannot find -l:/nix/store/5kqscq1vk49zpjw5h3gqmnlzb87wfvli-odin-0-unstable-2024-08-05/share/vendor/raylib/linux/libraylib.a: No such file or directory
When I check the respective locations, I can see the static library files are where they are supposed to be. So then why does ld state they are not present?
Use autoPatchelfHook as suggested on the forum post I made.
Manually point to the static library files by using NIX_CFLAGS_COMPILE, i.e. -l${odin}/share/vendor/raylib/linux/libraylib.a and -l${odin}/share/vendor/raylib/linux/libraygui.a.
Copied the static library files in my home directory, and manually pointed to them as above.
Enabled RAYLIB_SHARED as an option for Odinlang, which makes use of the dynamic library instead of the static ones.
For the time being, I use nix-ld to acquire the needed libraries after which I merge LD_LIBRARY_PATH with NIX_LD_LIBRARY_PATH using environment.sessionVariables.
This is an issue with the Odin compiler. It cannot link to libraries shipped into the compiler, you have to compile the libraries with Nix, or fetch it from nixpkgs. But currently in nixos-unstable, raylib is still in version 5.0 but the Odin binding from the latest compiler is in version 5.5.
Describe the bug
When I try to build my Odinlang project using nix-build -A package, I get the following errors:
When I check the respective locations, I can see the static library files are where they are supposed to be. So then why does ld state they are not present?
Steps To Reproduce
Package derivation
Expected behavior
The package should build. I also have a nix develop flake, which works and lets me compile the project as well as execute it.
Nix develop flake
Additional context
I have tried the following:
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: