binji / wasm-clang

Running Clang/LLD in WebAssembly Demo
https://binji.github.io/wasm-clang
Apache License 2.0
259 stars 27 forks source link

Issue for adding a new method in Canvas library and what to do to add a personal C++ library #15

Closed GRicciardi00 closed 1 year ago

GRicciardi00 commented 1 year ago

I've tried to add a new method called mydebug() in "include/canvas.h" and "sysroot/include/canvas.h" and finally implemented it in shared.js (also in the const env defined into the class App) but the compiler doesn't recognize it. Also I would like to know what I should do to add a personal library for C++ .

binji commented 1 year ago

What error do you get? Are you sure that it's loading the new header and not cached?

GRicciardi00 commented 1 year ago

The compiler doesn't recognize the new function, the error given is: "use of undeclared identifier 'mydebug' mydebug();". I think that the problem is that I made the changes in the folders extracted from the sysroot.tar without having recompressed the archive again. I tried to do this but now the compiler doesn't recognize any library but I can't figure out why. Thank you for replying

GRicciardi00 commented 1 year ago

So I solved the problem because I was tarring the files with MacOS and I solved it by creating the .tar on linux.