Take a look at
https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html
.

Most likely you want to create some kind of wrapper around zlib, or at
least build a new program that exports that native Zlib functions that you
want to call from JS.  The sample programs that you get with zlib are
probably not what you want for running on the web.

If its just zlib you want then you don't even need to compile it yourself
since emscripten supplies its own version of zlib when you specify the
`-sUSE_ZLIB` command line flag.

For example you could build with `./emcc empty.c -sUSE_ZLIB
-sEXPORTED_FUNCTIONS=_inflate` .. then the resulting JS file with have a
function called Module._inflate that corresponds to the native inflate
function in zlib.   You would also write a wrapper around the inflate
function either in JS or in C/C++ that would make it easier to use.  There
are several ways to do that listed in the above docs.

cheers,
sam

On Tue, Sep 6, 2022 at 4:03 AM Sayantan Sadhukhan <
[email protected]> wrote:

> no not reaaly,i have generated the wasm & the corresponding js of it.. but
> im the issues while using it.
> i have generated the wasm of a zlib c library ,in return i got 4 wasm
> files example.wasm ,example64.wasm,minigzip.wasm,mingzip64.wasm
> & their corresponding .js files . i need help to figure out how i can use
> those modules to compress & decompress files in a web environ ment..
>
> On Monday, September 5, 2022 at 11:57:41 PM UTC+5:30 [email protected]
> wrote:
>
>> Emscripten will generate a .js file for that takes care of loading the
>> WebAssembly module.  Are you using the generated .js file?
>>
>> On Sat, Sep 3, 2022 at 12:31 AM Sayantan Sadhukhan <
>> [email protected]> wrote:
>>
>>> I have Generated to *WASM* modules using *emcmake *but when ever i try
>>> to load the Module into Web Environment .its not instantiating anyway. need
>>> help to load that nodule & use its functions .for example  port *Zlib *into
>>> *WebAssembly *use the library to compress files
>>>
>>> --
>>> 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 on the web visit
>>> https://groups.google.com/d/msgid/emscripten-discuss/040fc901-d9cd-4314-98e3-65d488a5c9bcn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/emscripten-discuss/040fc901-d9cd-4314-98e3-65d488a5c9bcn%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 on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/77e710a2-fceb-4b54-9a18-a354be812059n%40googlegroups.com
> <https://groups.google.com/d/msgid/emscripten-discuss/77e710a2-fceb-4b54-9a18-a354be812059n%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 on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va297pdyNsq2aWT3_YE9kmb41PqMDD5hKELKijHUxWmJw-Q%40mail.gmail.com.

Reply via email to