Skip to content

zig cc - lld-link: error: could not open '<file>.lib': #8526

Description

@benstigsen

Tested with the following versions:

Operating System: Windows 10 19042

So, I just downloaded Zig, and I have this Raylib project.
This is what my project looks like:

main.c
main.h
include\
  raygui.h
  raylib.h
  ricons.h
lib\
  libraylib.a
  libraylibdll.a
  raylib.dll

When I run this with GCC it works:
gcc main.c -Iinclude/ -Llib/ -lraylib -lgdi32 -limm32 -lwinmm -o main.exe

When I run this with Zig, it does not:
zig cc main.c -Iinclude/ -Llib/ -lraylib -lgdi32 -limm32 -lwinmm -o main.exe

I tried adding the target like so:
zig cc main.c -target x86_64-windows-gnu -Iinclude/ -Llib/ -lraylib -lgdi32 -limm32 -lwinmm -o main.exe

But both of these result in the error lld-link: error: could not open 'raylib.lib': No such file or directory

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions