Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues cross-compiling with MinGW #65

Open
NoName57 opened this issue May 20, 2022 · 1 comment
Open

Issues cross-compiling with MinGW #65

NoName57 opened this issue May 20, 2022 · 1 comment

Comments

@NoName57
Copy link

NoName57 commented May 20, 2022

I am having similar issues with what was going on with is post: #33 (comment)

The solution that worked for that poster is not working for me in this case by adding the {.passl: "-lz".} option to the libzip.nim file. I am simply just trying to compile a test of zip/zipfiles. The error output is below.

Hint:  [Link]
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x3c8): undefined reference to `crc32'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x445): undefined reference to `deflateInit2_'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x4a0): undefined reference to `deflateEnd'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x4c5): undefined reference to `crc32'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x4d2): undefined reference to `deflate'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x556): undefined reference to `deflateEnd'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x61d): undefined reference to `zError'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x1408): undefined reference to `zError'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x1470): undefined reference to `inflateEnd'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x1528): undefined reference to `crc32'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x1570): undefined reference to `crc32'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x188b): undefined reference to `crc32'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x1997): undefined reference to `inflateInit2_'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x261b): undefined reference to `crc32'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x2649): undefined reference to `inflate'
/usr/bin/x86_64-w64-mingw32-ld: /home/chris/.cache/nim/zip_r/libzip_all.c.o:libzip_all.c:(.text+0x26a8): undefined reference to `crc32'
collect2: error: ld returned 1 exit status
Error: execution of an external program failed: '/usr/bin/x86_64-w64-mingw32-gcc   -o /home/chris/Desktop/Nim/Client/Test/zip.exe  /home/chris/.cache/nim/zip_r/libzip_all.c.o /home/chris/.cache/nim/zip_r/stdlib_digitsutils.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_assertions.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_dollars.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_widestrs.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_io.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_system.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_streams.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_math.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_dynlib.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_winlean.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_times.nim.c.o /home/chris/.cache/nim/zip_r/@m..@s..@s..@s..@[email protected]@[email protected]@[email protected] /home/chris/.cache/nim/zip_r/stdlib_win_setenv.nim.c.o /home/chris/.cache/nim/zip_r/stdlib_os.nim.c.o /home/chris/.cache/nim/zip_r/@m..@s..@s..@s..@[email protected]@[email protected]@[email protected] /home/chris/.cache/nim/zip_r/@mzip.nim.c.o   -s  '

I was also having issues before this where it was unable to find zlib.h during compilation so I put zlib.h with ~/.nimble/pkgs/zip-0.3.1/zip/private/libzip_all.c in the same directory and changed the #include <zlib.h> to #include "zlib.h" because it wasn't finding it in /usr/include even when I compiled with --cincludes:/usr/include. So after I made that change it was able to find zlib.h and now I am getting the error above with the undefined references.

Anybody know why this is or what I could do to work around it?

I am running Nim Compiler ver 1.6.4 and the latest Zip which is pretty old. Are there any other more recent options for zipping up files?

Thanks.

@ShujianDou
Copy link

Using Zippy (https://github.com/guzba/zippy) would probably be the best option for zipping files in nim atm. Even when I could get it to build, through the use of a windows vm, #45 made it pointless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants