You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I compiled zlib v1.2.11 and made it available to MingW using the instructions from here & here
I then ran the following command to cross-compile the above Nim code and point the linker and compiler to the zlib directory:
nim c -d=useLibzipSrc -d=debug -d=mingw --embedsrc=on --hints=on --app=console --cpu=amd64 --passL:"-L/home/byt3bl33d3r/Devel/zlib-1.2.11 -lzlib1" --passC:"-I/home/byt3bl33d3r/Devel/zlib-1.2.11" --out=bin/embed_rsrc_bin_64.exe src/embed_rsrc_bin.nim
This gives the following error when compiled:
Hint: used config file '/usr/local/nim/config/nim.cfg' [Conf]
Hint: used config file '/usr/local/nim/config/config.nims' [Conf]
........................CC: libzip_all
CC: ../../../.nimble/pkgs/zip-#head/zip/libzip.nim
CC: ../../../.nimble/pkgs/zip-#head/zip/zipfiles.nim
Hint: [Link]
/usr/bin/x86_64-w64-mingw32-ld: /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/@m..@s..@[email protected]@spkgs@szip-@hhead@[email protected]:@m..@s..@[email protected]@spkgs@szip-@hhead@[email protected]:(.text+0x680): undefined reference to `zip_source_buffer_create'
/usr/bin/x86_64-w64-mingw32-ld: /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/@m..@s..@[email protected]@spkgs@szip-@hhead@[email protected]:@m..@s..@[email protected]@spkgs@szip-@hhead@[email protected]:(.text+0x77c): undefined reference to `zip_open_from_source'
collect2: error: ld returned 1 exit status
Error: execution of an external program failed: '/usr/bin/x86_64-w64-mingw32-gcc -o /home/byt3bl33d3r/Devel/OffensiveNim/bin/embed_rsrc_bin_64.exe /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/libzip_all.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_assertions.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_widestrs.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_io.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_system.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_streams.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_parseutils.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_unicode.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_strutils.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_dynlib.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_winlean.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_times.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/@m..@s..@[email protected]@spkgs@szip-@hhead@[email protected] /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_pathnorm.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_os.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/@m..@s..@[email protected]@spkgs@szip-@hhead@[email protected] /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/stdlib_strformat.nim.c.o /home/byt3bl33d3r/.cache/nim/embed_rsrc_bin_d/@membed_rsrc_bin.nim.c.o -L/home/byt3bl33d3r/Devel/zlib-1.2.11 -lzlib1 '
After some investigation libzip.nim has those two functions defined however they're not actually in the libzip_all.c file. It seems like those two functions are only available in libzip starting from version >= 1.0 (the current libzip_all.c file seems to be based off of libzip 0.9?).
I'm not sure If i'm doing something wrong here, but I think that's the problem.
Thanks.
The text was updated successfully, but these errors were encountered:
byt3bl33d3r
changed the title
"zip_open_from_source" & "zip_source_buffer_create" are not defined when cross-compiling to Windows
zip_open_from_source() & zip_source_buffer_create not defined in libzip_all.c
Mar 24, 2021
byt3bl33d3r
changed the title
zip_open_from_source() & zip_source_buffer_create not defined in libzip_all.c
zip_open_from_source() & zip_source_buffer_create() not defined in libzip_all.c
Mar 24, 2021
Heya,
I'm trying to get this library working when cross-compiling to Windows using the MingW toolchain, this is the Nim code i'm using:
I compiled
zlib v1.2.11
and made it available to MingW using the instructions from here & hereI then ran the following command to cross-compile the above Nim code and point the linker and compiler to the
zlib
directory:This gives the following error when compiled:
After some investigation
libzip.nim
has those two functions defined however they're not actually in thelibzip_all.c
file. It seems like those two functions are only available inlibzip
starting from version >= 1.0 (the currentlibzip_all.c
file seems to be based off oflibzip
0.9?).I'm not sure If i'm doing something wrong here, but I think that's the problem.
Thanks.
The text was updated successfully, but these errors were encountered: