schellingb / wajic

WebAssembly JavaScript Interface Creator
zlib License
193 stars 5 forks source link

Issue with Automatic and Manual Building #9

Open Grobe-Kartoffel opened 2 months ago

Grobe-Kartoffel commented 2 months ago

I don't know if you're still working on this at all, or if you've touched the code recently enough to help me, but I tried getting Emscripten to work and the javascript it produced kept producing errors for me, so I found this to try to get something that would compile for the browser.

I'm on Windows 11, my wajic folder looks like this: Screenshot 2024-07-18 225310

I tried running this command: 'node wajicup.js Samples/Basic.c Basic.html' and I get this error: Screenshot 2024-07-18 225512

That error, I figured out is because '-fvisibility=hidden' is mistyped as '-fvisibility hidden' I tried going into the wajic.mk file and I thought I fixed that error, but it was still happening. After that, I decided to just try the manual build: 'clang -I. -Os -target wasm32 -nostartfiles -nodefaultlibs -nostdinc -nostdinc++ -Wno-unused-command-line-argument -DNDEBUG -DWAJIC -fvisibility=hidden -fno-rtti -fno-exceptions -fno-threadsafe-statics -Xlinker -strip-all -Xlinker -gc-sections -Xlinker -no-entry -Xlinker -allow-undefined -Xlinker -export=__wasm_call_ctors -Xlinker -export=main samples/Basic.c -o Basic.wasm' From that, I get this error: Screenshot 2024-07-18 225833

I have no idea what's wrong on my end or how to fix it. If you could at least get back to me to let me know I need to find another Emscripten alternative, that would be much appreciated. Thanks for your time.

houmain commented 5 hours ago

I just ran into the same problem. For some reason these "\x11" escape sequences are no longer allowed here. I could not find a better solution than to insert the control character directly. I added a #define DC1 "" and replaced all "\x11" with DC1. Here is my patched wajic.h.