wizer icon indicating copy to clipboard operation
wizer copied to clipboard

Wizer and Emscripten

Open overocean opened this issue 4 years ago • 3 comments
trafficstars

Hi all,

Not sure whether Wizer is supposed to work with Emscripten. I tried compiling the following c++ code with emcc

#include <iostream>
#include <wizer.h>
#include <emscripten.h>

WIZER_DEFAULT_INIT();

EMSCRIPTEN_KEEPALIVE int SayHello() {
    std::cout << "Hello World!";
    return 0;
}

I got some compiling errors.

overocean avatar May 29 '21 17:05 overocean

All the Wizer and C++ testing we've done so far has been with wasi-sdk and main functions. We haven't done anything with Emscripten or without a main function.

In principle, it should work, but may require a different header to include or tweaks to the existing header, since the existing header bakes in some knowledge of the wasi-sdk libc. We will probably need to do equivalent-but-Emscripten-specific things for Emscripten's libc.

cc @sunfishcode, who knows a bit more about Emscripten than I do.

fitzgen avatar Jun 01 '21 17:06 fitzgen

All I know right now is that Emscripten changed how its main function works since I last looked at it.

sunfishcode avatar Jun 01 '21 18:06 sunfishcode