Skip to content

Unknown field addStaticLibrary #1

Description

@IngwiePhoenix

Hello!

So small precursor, I basically just discovered Zig and it's build system capabilities and I am still a little mindblown how I missed one of the coolest things. Completely nerdsniped, effectively.

While trying out the libarchive build, I discovered this:

PS C:\Users\Ingwie Phoenix\work> git clone https://github.com/allyourcodebase/libarchive
Cloning into 'libarchive'...
remote: Enumerating objects: 35, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 35 (delta 16), reused 35 (delta 16), pack-reused 0 (from 0)
Receiving objects: 100% (35/35), 11.71 KiB | 3.90 MiB/s, done.
Resolving deltas: 100% (16/16), done.
PS C:\Users\Ingwie Phoenix\work> cd .\libarchive\
PS C:\Users\Ingwie Phoenix\work\libarchive> zig build
C:\Users\Ingwie Phoenix\AppData\Local\zig\p\zlib-1.3.1-AAAAACEMAAA0qyoSrfgBb_p25ItL4yRf_TBRk-26TYMF\build.zig:5:18: error: no field or member function named 'addStaticLibrary' in 'Build'
    const lib = b.addStaticLibrary(.{
                ~^~~~~~~~~~~~~~~~~
C:\Users\Ingwie Phoenix\AppData\Local\Microsoft\WinGet\Packages\zig.zig_Microsoft.Winget.Source_8wekyb3d8bbwe\zig-x86_64-windows-0.15.2\lib\std\Build.zig:1:1: note: struct declared here
const std = @import("std.zig");
^~~~~
C:\Users\Ingwie Phoenix\AppData\Local\zig\p\zlib-1.3.1-AAAAACEMAAA0qyoSrfgBb_p25ItL4yRf_TBRk-26TYMF\build.zig:5:18: note: method invocation only supports up to one level of implicit pointer dereferencing
C:\Users\Ingwie Phoenix\AppData\Local\zig\p\zlib-1.3.1-AAAAACEMAAA0qyoSrfgBb_p25ItL4yRf_TBRk-26TYMF\build.zig:5:18: note: use '.*' to dereference pointer
referenced by:
    runBuild__anon_84867: C:\Users\Ingwie Phoenix\AppData\Local\Microsoft\WinGet\Packages\zig.zig_Microsoft.Winget.Source_8wekyb3d8bbwe\zig-x86_64-windows-0.15.2\lib\std\Build.zig:2214:33
    dependencyInner__anon_81945: C:\Users\Ingwie Phoenix\AppData\Local\Microsoft\WinGet\Packages\zig.zig_Microsoft.Winget.Source_8wekyb3d8bbwe\zig-x86_64-windows-0.15.2\lib\std\Build.zig:2195:29
    8 reference(s) hidden; use '-freference-trace=10' to see all references
build.zig:28:18: error: no field or member function named 'addStaticLibrary' in 'Build'
    const lib = b.addStaticLibrary(.{
                ~^~~~~~~~~~~~~~~~~
C:\Users\Ingwie Phoenix\AppData\Local\Microsoft\WinGet\Packages\zig.zig_Microsoft.Winget.Source_8wekyb3d8bbwe\zig-x86_64-windows-0.15.2\lib\std\Build.zig:1:1: note: struct declared here
const std = @import("std.zig");
^~~~~
build.zig:28:18: note: method invocation only supports up to one level of implicit pointer dereferencing
build.zig:28:18: note: use '.*' to dereference pointer

I am on Windows 10, and my version of Zig is 0.15.2. I tried with the default target (x86_64-windows-gnu, so, mingw) and x86_64-windows-msvc. Both of them produce the same error.

Kind regards,
Ingwie. :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions