rust-cross / cargo-zigbuild

Compile Cargo project with zig as linker
MIT License
1.55k stars 57 forks source link

An error occured when I try to build for `x86_64-pc-windows-gnu` platform with Mac M1 #112

Closed xdm67x closed 1 year ago

xdm67x commented 1 year ago

An error occured when I try to build for x86_64-pc-windows-gnu platform with Mac M1.

The error,

warning: unsupported linker arg: /var/folders/z1/tj3rwht518jgd4f89573gph40000gn/T/rustcaeAJFU/list.def
          error(link): DLL import library for -lsynchronization not found
          error: DllImportLibraryNotFound
messense commented 1 year ago

zig doesn't ship import library for synchronization, you should report it to zig instead.

$ cat hello.c
#include <stdio.h>

int main(void) {
  printf("hello");
  return 0;
}

$ zig cc hello.c -o hello -target x86_64-windows-gnu -lsynchronization
LLD Link... error(link): DLL import library for -lsynchronization not found
error: DllImportLibraryNotFound
messense commented 1 year ago

Added a workaround for this in #116, v0.16.4 should work for you.

theoparis commented 8 months ago

I got this just now 😕

 error: unable to find Dynamic system library 'synchronization' using strategy 'paths_first'. searched paths:
            /home/theoparis/Documents/tinted/work/coreutils/target/x86_64-pc-windows-gnu/release/deps/synchronization.dll