How to use 'val' as a type for global vars

15 views
Skip to first unread message

Dat Dinhquoc

unread,
Jan 27, 2022, 8:49:19 AM1/27/22
to emscripten-discuss
I wish to assign some frequently used JS functions to global 'val' variables:
#include <emscripten>
#include <emscripten/val.h>
val log;
int main(){
    log = val::global("console")["log"];
}

But faced this error:
fatal error: call to deleted constructor of 'emscripten::val'
val log;


All other types are fine to be globals.

Reply all
Reply to author
Forward
0 new messages