-
Hi I assume your builds dont have php-glfw in them yet, I tried to run some code that uses that extension, I got some errors. thanks! hmm it says it has glfw in it but cannot be linked statically? what does that mean I have the extension added to my regular php and it works, Id like to get yours working too |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 12 replies
-
glfw depends on OpenGL(required) and X11(alternative in Linux). These libraries cannot be compiled statically, or it's very difficult. On macOS platform, we can dynamically link the system framework and ship it with no pain, just not use the old version of macOS. |
Beta Was this translation helpful? Give feedback.
-
linux build reference : Off-screen Rendering. https://docs.mesa3d.org/osmesa.html |
Beta Was this translation helpful? Give feedback.
-
thanks, |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Looks like almost-statically linked binaries for Linux and macOS is possible to add glfw in the php-cli or micro.sfx. But yet I haven't tried it. Alternatively, the latest static-php-cli can build shared extension too (portable so file), that may also help glfw extension build for Linux. |
Beta Was this translation helpful? Give feedback.
-
I took a look at this and it has an insane dependency tree that, among others, also includes the whole massive X11 system. The only feasible solution for this is to link against systen glfw dynamically, which can be done with SPC_TARGET="musl -dynamic" for Alpine or SPC_LIBC=glibc for glibc systems like Debian, Ubuntu, Mint, RHEL or anything in between. You need to add glfw ext to the project yourself and use PKG_CONFIG_PATH=/usr/lib(64)/pkgconfig bin/spc build ... But you do not end up with a portable binary. Every user will then need to have the correct glfw version installed to even run your php binary for anything. |
Beta Was this translation helpful? Give feedback.
I took a look at this and it has an insane dependency tree that, among others, also includes the whole massive X11 system. The only feasible solution for this is to link against systen glfw dynamically, which can be done with SPC_TARGET="musl -dynamic" for Alpine or SPC_LIBC=glibc for glibc systems like Debian, Ubuntu, Mint, RHEL or anything in between. You need to add glfw ext to the project yourself and use PKG_CONFIG_PATH=/usr/lib(64)/pkgconfig bin/spc build ...
But you do not end up with a portable binary. Every user will then need to have the correct glfw version installed to even run your php binary for anything.