|
I've tried building on my native host (NixOS) as well as fresh Debian and Arch VMs (with dependencies ofc). I am always hit with a littany of compile errors before the build fails. Am I not supposed to build this library and just use the headers? If so, how am I supposed to use this in a language which only supports linking against precompiled binaries? For reference, I am trying to use this with Odin. |
Replies: 2 comments 2 replies
|
Hi! Thanks for the interest! There's a lot to unpack here so I'll try to approach it piece by piece.
NixOS is technically unsupported but the Debian and Arch VMs should have compiled the examples or the demo without issues, though Arch has a few extra manual steps that need to be applied as compared to Debian's list of packages. I would be curious to hear about what issues were encountered here or detailed errors if possible as well. In my testing, I copy and paste from the README (minus the QCustomPlot package on Arch that requires the AUR, mostly due to laziness).
The library should work with any toolchain that can compile C and C++ but it is supported with the Zig toolchain. The library targets stable releases of the Zig toolchain. When compiled by Zig, by default, the static library assets that successfully built should be located in the
In theory, this might work as-is with Odin but it has not been tested and is technically not supported. To my knowledge though, with the headers and the precompiled static libraries, this should work as a vendored dependency with Odin's built-in foreign system. It may require platform-specific handling that is handled by the library in the build system, such as ensuring the GNU C++ ABI is used on Linux-based operating systems. Without the actual errors, it's difficult to speculate about what to troubleshoot though. For long-term consumption, I would encourage interested parties to fork either this library or the bindings for Zig and generate wrappers for Odin as close to idiomatic as possible to simplify use and portability. I understand that is a larger endeavor but I think if long-term and serious consumption is the goal, it is work that is worth it. As a sort of P.S. to the above, so far folks have gotten this library working with C# and Assembly (image below), both as-is, so it should certainly be possible for Odin. 😄
|
|
Okay, I think my issue here is that I was trying to build this project directly (not the examples or demo). I guess I'll have to look into how those are done, although I am extremely unfamiliar with the zig toolchain. As for the errors: |

Since your goal is to use the static library assets, you're actually correct here! The error looks like you missed copying the directory on Arch. (I'm not a fan of the instructions but they're the only way I've managed to get it to work on Arch so far. Debian and Fedora have auxiliary packages that subvert this manual hackery but Arch does not. 😔)
The Zig toolchain was chosen over CMake, Make, Meson, etc. for many reasons, mostly ease of use. If you download the version of Zig linked on the badge in the README for your o…