hi, On Thu, 20 Jul 2023 00:47:07 -0700 (PDT) Ronny Nissengold <ronny....@gmail.com> wrote:
> Using malloc didn't work. did using cwrap() work? see: https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html > By setting the coop policy, using requestly, I now get new errors: > Refused to execute script from > 'http://localhost:8000/blink_landmark_detector_sample.js' because its MIME > type ('text/plain') is not executable. > At least now SharedArrayBuffer is recognised. > Looks like I am close but still no cigar. > Any ideas? > Thanks. > > ב-יום חמישי, 20 ביולי 2023 בשעה 09:55:27 UTC+3, Shlomi Fish כתב/ה: > > > hi Ronny! > > > > On Wed, 19 Jul 2023 02:45:53 -0700 (PDT) > > Ronny Nissengold <ronn...@gmail.com> wrote: > > > > > Thank you all for your support. > > > I was able to successfully compile my project with pthread enabled. > > > Now I face a new problem, I used Module._malloc to pass an image from a > > > webcam into my cpp function > > > For that I used the following linker > > > flags: add_link_options(-sINITIAL_MEMORY=800MB -sTOTAL_STACK=80MB -O3 -s > > > -sEXPORTED_FUNCTIONS=['_malloc','_free'] -sASSERTIONS -pthread) > > > > > > Now I get the following error in my console: > > > > > > Uncaught ReferenceError: SharedArrayBuffer is not defined > > > at blink_landmark_detector_sample.js:1:9999 > > > > > > (index):11 Uncaught TypeError: Module._malloc is not a function > > > at _arrayToHeap ((index):11:24) > > > at HTMLVideoElement.computeFrame ((index):40:22) > > > > > > Any idea what happened? > > > > try using 'Module.malloc' [without the underscore] or 'cwrap'. > > > > HTH -- Shlomi Fish https://www.shlomifish.org/ https://www.shlomifish.org/humour/bits/New-versions-of-the-GPL/ Yawn! Too TL;DR! Dude, do you even tweet? — https://twitter.com/shlomif/status/504931822757638144 Please reply to list if it's a mailing list post - https://shlom.in/reply . -- 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-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/20230721085722.232c69e3%40telaviv1.shlomifish.org.