www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Loading of wasm function fails

reply dokutoku <dokutoku users.noreply.github.com> writes:
I try to use wasm with LDC, but I can not load wasm functions 
with the following message even if I write it the same as the 
"Generating WebAssembly with LDC" page on wiki

TypeError: exports.add is not a function

How can I solve this problem?
Apr 22 2019
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Monday, 22 April 2019 at 10:36:23 UTC, dokutoku wrote:
 How can I solve this problem?
I played with this last week, try adding -L--export-dynamic to your ldc command line to build. I mentioned it briefly on my blog last week http://dpldocs.info/this-week-in-d/Blog.Posted_2019_04_15.html#what-adam-is-working-on
Apr 22 2019
parent dokutoku <dokutoku users.noreply.github.com> writes:
On Monday, 22 April 2019 at 13:05:03 UTC, Adam D. Ruppe wrote:
 On Monday, 22 April 2019 at 10:36:23 UTC, dokutoku wrote:
 How can I solve this problem?
I played with this last week, try adding -L--export-dynamic to your ldc command line to build. I mentioned it briefly on my blog last week http://dpldocs.info/this-week-in-d/Blog.Posted_2019_04_15.html#what-adam-is-working-on
It was possible! Thank you! I will check your blog regularly as well.
Apr 22 2019