Zig 0.15 and linkLibrary() #1
Open
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)
wherelib
is 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