Assertion failed: missing linked function `_emscripten_log`. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment
test1.c:
#include <dlfcn.h>
#include <stdio.h>
#include <pthread.h>
#include <emscripten.h>
int main(int ac, char **av)
{
void *handle = dlopen("./libwasmdog.wasm", RTLD_LAZY);
void (*fun_print_name)(const char *) = dlsym(handle, "print_name");
fun_print_name(av[1]);
/*
emscripten_log(EM_LOG_CONSOLE, "removing this call will brake linking\n");
emscripten_debugger();
*/
return 0;
}
EMCC_FORCE_STDLIBS=1 emcc -g -s MAIN_MODULE=1 test1.c -o test.html --preload-file ./libwasmdog.wasm -s ALLOW_MEMORY_GROWTH=1
dog.c:
#include "animal.h"
#include <stdio.h>
#include <stdlib.h>
#include <emscripten.h>
void print_name(const char *type)
{
emscripten_log(EM_LOG_JS_STACK, "\n");
emscripten_debugger();
printf("Je suis un %s\n", type);
}
emcc -g -s SIDE_MODULE=1 dog.c -o libwasmdog.wasm -s "EXPORTED_FUNCTIONS=['_emscripten_log', '_emscripten_debugger']"
--Thank you!
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/470197cd-6ade-440b-a945-9e271b09c77f%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2_WuveDwGK1UEAq%3DopKnF_5eDqzpo3R_%3DQVr_Sz2gR%3DEQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpQHgW%3D7u5xVJktq%2BfYHvBCPvMx%3Dpy4pKbr3Pw3hCRqi6Q%40mail.gmail.com.