Closed auroraanna closed 1 year ago
Hey, thanks for the link to your discussion! What is the exact command executed when you run nimble run
?
This is the first time I see this error and it could be connected to NixOS. If you would like to tweak your build options, you can discover your package path with nimble path nimraylib_now
and there the file nimraylib_now/static_build.nim is like a "Makefile". You can also inspect the exact commands used to build raylib with nim --listCmd ...
so that you have a full view of all the paths used to C compiler etc.
The command compiles and run my project consisting of snekim.nimble
:
# Package
version = "0.1.0"
author = "Anna Aurora"
description = "Snake"
license = "LGPL-3.0-or-later"
srcDir = "src"
bin = @["snekim"]
# Dependencies
requires "nim >= 1.6.6"
requires "nimraylib_now"
and src/snekim.nim
:
import nimraylib_now
when isMainModule:
initWindow(1280, 720, "Hello, World!")
while not windowShouldClose():
beginDrawing()
drawRectangle(100, 100, 200, 300, RED)
endDrawing()
Unfortunately I don't think I can help with just the information I have right now. There are some debugging techniques I have listed above that would help you to figure out the correct path to resolve it.
You can still use NimraylibNow! bindings with a dynamic library .so
, see here for details. Using a system-provided Raylib library is the easiest option. By default I try to statically compile all the C code which produces some strange issues on NixOS for some reason.
Figured it out! Running the binary works with steam-run
.
I didn't think of this because I ususally only try steam-run
with executables where the error is zsh: no such file or directory
.
steam-run
should only be needed for development too since the error should go away when a nixpkg is created for my game.
Okay, great to know! I'm not familiar with this steam-run
so I wonder if this is going to be useful to other people as well, maybe I should put it into a troubleshooting section?
Would be useful to NixOS users I guess tho they might also find this issue when they get the same error.
Not sure :woman_shrugging: steam-run
is kind of general knowledge on NixOS.
Added to the troubleshooting section. If this "general knowledge" was not the first thing you tried to do, I guess it is not obvious enough so we better include it for future people to not stumble upon this issue and make them search for the answer.
So, steam-run runs something in an FHS environment which NixOS does not have by default.
Unfortunately I don't think I can help with just the information I have right now. There are some debugging techniques I have listed above that would help you to figure out the correct path to resolve it.
You can still use NimraylibNow! bindings with a dynamic library
.so
, see here for details. Using a system-provided Raylib library is the easiest option. By default I try to statically compile all the C code which produces some strange issues on NixOS for some reason.
Huh, dunno why I didn't listen to you and try shared library… it works now with raylib installed and nimble build -d:nimraylib_now_shared
.
Maybe you could add a note to the troubleshooting that you should use shared library on NixOS?
Great, thanks! Added.
No window comes up when I try to run my program (which uses nimraylib_now of couse). I get this error:
We already checked in the raylib discord that it's not a fault of my hardware or drivers.