Open
Conversation
added 2 commits
September 14, 2025 17:00
…ace in zig 0.15 2. Improved method of linking apps against shared and static libraries. Use `linkLibrary()` function rather than `addObject()`. This is better because one does not have to specify the library file name which vary by system type. 3. Added 2 more pure c examples. Link against a static lib and link against a dynamic lib 4 Another breaking change `callconv(.c)` the .c should now be lowercase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HI, I am new to Zig and found your repo while looking for hints on how to compile and link C projects with zig build.
So I cloned your repo and set to work trying to get it working and understand it. It helped a lot even though it did not work.
My zig is 0.15.1 and there have been some breaking changes. Which I think I have fixed. They are:
callconv(.C)now requirescallconv(.c)- lower case not upper.In addition you used
exe.addObjectFile(b.path("zig-out/lib/zmath-shared.lib"));to pull in the libraries. That library name is windows specific. I changed those statements toexe.linkLibrary(lib)wherelibis passed into the specific build script as an argument.Anyway if you like the fixes/changes feel free to accept the pull. If not no sweat.
Rob