-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add purego support for unix #361
base: master
Are you sure you want to change the base?
Conversation
Thanks, does it work now, did you test it? For |
It does work! I just spun up this test program: func main() {
rl.InitWindow(800, 450, "purego")
defer rl.CloseWindow()
for !rl.WindowShouldClose() {
rl.BeginDrawing()
rl.ClearBackground(rl.RayWhite)
rl.DrawText(fmt.Sprintf("CGO_ENABLED=%v", os.Getenv("CGO_ENABLED")), 190, 200, 20, rl.LightGray)
rl.EndDrawing()
}
} Running with Edit: Just wanted a little more proof to be certain: test is the same executable as above
|
Nice. As it is, it will work only if you are starting the binary from that directory, right? It should probably use something like For darwin, no idea what locations it searches, probably best to just check binary dir. |
That was the intention, but your suggestion is definitely better, I'll update with this. I have no idea about darwin either :D but I'll update to not search current directory |
How does this sound, having the loadLibrary function check current directory for a library, then goes for the executable directory? |
Yes, that is fine. I never use |
I use it almost exclusively :D, good both bases are covered, will update in a few minutes |
So I think this is a good iteration. If someone is using I've tested the current iteration and it loads it correctly |
Purego still doesn't work with structs (datatypes lager 64 bits). |
That's the purego issue for supporting structs on linux: |
@gen2brain I managed to get a prototype running with purego and libffi: You can find the example here: |
No description provided.