On Thu, Oct 31, 2024 at 6:27 AM Davide Mercanti <[email protected]>
wrote:

>
>
> I don't understand how I can set up a project to use zlib (USE_ZLIB=1)
> with MSVC 2019 and cmake.
>
> Is am example project available?
>
> These are my outputs
>
> D:\MERCHANTS\em\emsdk\upstream\emscripten\em++.bat
> -ID:/MERCHANTS/em/emsdk/upstream/emscripten/system/include -g -MD -MT
> CMakeProject1/CMakeFiles/CMakeProject1.dir/CMakeProject1.cpp.o -MF
> CMakeProject1\CMakeFiles\CMakeProject1.dir\CMakeProject1.cpp.o.d -o
> CMakeProject1/CMakeFiles/CMakeProject1.dir/CMakeProject1.cpp.o -c
> ../../../CMakeProject1/CMakeProject1.cpp
>  [2/2] cmd.exe /C "cd . &&
> D:\MERCHANTS\em\emsdk\upstream\emscripten\em++.bat -g --bind -s USE_ZLIB=1
> -s EXPORT_ALL=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s FORCE_FILESYSTEM=1 -s
> EXPORTED_RUNTIME_METHODS=['ccall','cwrap'] -s
> EXPORTED_FUNCTIONS=['_print_file','_testdouble_array','_malloc','_free','_unzip_file']
> CMakeProject1/CMakeFiles/CMakeProject1.dir/CMakeProject1.cpp.o -o
> CMakeProject1\MyFirstWASM.html && cd .'
>  FAILED: CMakeProject1/MyFirstWASM.html
>  cmd.exe /C "cd . && D:\MERCHANTS\em\emsdk\upstream\emscripten\em++.bat -g
> --bind -s USE_ZLIB=1 -s EXPORT_ALL=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s
> FORCE_FILESYSTEM=1 -s EXPORTED_RUNTIME_METHODS=['ccall','cwrap'] -s
> EXPORTED_FUNCTIONS=['_print_file','_testdouble_array','_malloc','_free','_unzip_file']
> CMakeProject1/CMakeFiles/CMakeProject1.dir/CMakeProject1.cpp.o -o
> CMakeProject1\MyFirstWASM.html && cd ."
> D:\MERCHANTS\em\sources\CMakeProject1\out\build\x64-Debug\CMakeProject1\wasm-ld
> : error : CMakeProject1/CMakeFiles/CMakeProject1.dir/CMakeProject1.cpp.o:
> undefined symbol: zip_open
> D:\MERCHANTS\em\sources\CMakeProject1\out\build\x64-Debug\CMakeProject1\wasm-ld
> : error : CMakeProject1/CMakeFiles/CMakeProject1.dir/CMakeProject1.cpp.o:
> undefined symbol: zip_get_num_entries
> D:\MERCHANTS\em\sources\CMakeProject1\out\build\x64-Debug\CMakeProject1\wasm-ld
> : error : CMakeProject1/CMakeFiles/CMakeProject1.dir/CMakeProject1.cpp.o:
> undefined symbol: zip_stat_index
> D:\MERCHANTS\em\sources\CMakeProject1\out\build\x64-Debug\CMakeProject1\wasm-ld
> : error : CMakeProject1/CMakeFiles/CMakeProject1.dir/CMakeProject1.cpp.o:
> undefined symbol: zip_close
>


Those undefined symbols looks like they come from libzip, rather than zlib:
https://libzip.org/documentation/zip_get_num_entries.html

That means you will likely need to compile libzip and link it into your
project rather than using `-sUSE_ZLIB`.

cheers,
sam


>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/emscripten-discuss/6165639e-23cc-4f81-a2a0-adb89357599bn%40googlegroups.com
> <https://groups.google.com/d/msgid/emscripten-discuss/6165639e-23cc-4f81-a2a0-adb89357599bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va28ycVsbrw0%2Bf5-GEdHp2rc3mFCkhnVO1%3DHaYBCe1SHWeQ%40mail.gmail.com.

Reply via email to