Promblems when trying to run fetch api

37 views
Skip to first unread message

Jack Dale

unread,
Jul 23, 2019, 7:55:08 PM7/23/19
to emscripten-discuss
I have some C and C++ knowledge and I am bad at compiling(I have always used IDEs in the past to compile code).


I tried a simple example on Emscripten website about Fetch Api ( https://emscripten.org/docs/api_reference/fetch.html    The first example here)

I put the code info main.cpp file and tried compiling the code using:

emcc main.cpp -s FETCH=1

It gave the errors:

warning: unresolved symbol: emscripten_fetch_close
warning: unresolved symbol: emscripten_fetch_att_init
warning: unresolved symbol: emscripten_fetch 

I downloaded the file emscripten_fetch.cpp from github and put it into the same directory with main.cpp then tried compiling using:

emcc main.cpp emcc_fetch.cpp -s FETCH=1

This time the error messages changed to:

warning:unresolved symbol: emscripten_is_main_browser_thread
warning:unresolved symbol: emscripten_start_fetch
warning:unresolved symbol: _emscripten_fetch_free


When I viewed the file emscripten_fetch.cpp, I saw that although these functions are either called or declared
, they seem like they are not defined in the file.










Sam Clegg

unread,
Aug 19, 2019, 5:10:32 PM8/19/19
to emscripte...@googlegroups.com
On Tue, Jul 23, 2019 at 4:55 PM Jack Dale <jackdal...@gmail.com> wrote:
>
> I have some C and C++ knowledge and I am bad at compiling(I have always used IDEs in the past to compile code).
>
>
> I tried a simple example on Emscripten website about Fetch Api ( https://emscripten.org/docs/api_reference/fetch.html The first example here)
>
> I put the code info main.cpp file and tried compiling the code using:
>
> emcc main.cpp -s FETCH=1

This works for me.

I suspect you may be using a very old version of emscripten because
you are only getting warning (and not errors) for you undefined
symbols.

What does `emcc -v` produce?

cheers,
sam

>
> It gave the errors:
>
> warning: unresolved symbol: emscripten_fetch_close
> warning: unresolved symbol: emscripten_fetch_att_init
> warning: unresolved symbol: emscripten_fetch
>
> I downloaded the file emscripten_fetch.cpp from github and put it into the same directory with main.cpp then tried compiling using:
>
> emcc main.cpp emcc_fetch.cpp -s FETCH=1
>
> This time the error messages changed to:
>
> warning:unresolved symbol: emscripten_is_main_browser_thread
> warning:unresolved symbol: emscripten_start_fetch
> warning:unresolved symbol: _emscripten_fetch_free
>
>
> When I viewed the file emscripten_fetch.cpp, I saw that although these functions are either called or declared
> , they seem like they are not defined in the file.
>
>
>
>
>
>
>
>
>
>
> --
> 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 emscripten-disc...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/031ce26e-6c7d-4750-b0bc-779f3007da28%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages