skoppe / spasm

Write single page applications in D that compile to webassembly
MIT License
218 stars 17 forks source link

@safe function error when compiling example #40

Open Ezneh opened 4 years ago

Ezneh commented 4 years ago

Hi, while trying to compile any of the examples (dom / fetch), I get this error:

source\app.d(9,15): Error: @safe function _start cannot access __gshared data document source\app.d(19,15): Error: @safe function _start cannot access __gshared data document ldc2 failed with exit code 1.

I used the following commands:

dub upgrade dub run spasm:bootstrap-webpack dub build --compiler=ldc2 --build=release

My ldc2 version is the latest (1.19.0)

skoppe commented 4 years ago

Thank you for trying this out.

LDC 1.19.0 is not officially supported. see BUILDING.md

Ezneh commented 4 years ago

Oh alright thank you. I will try again with ldc 1.19 when it is supported. (It seems like that the tricks on the BUILDING.md file don't work)

skoppe commented 4 years ago

The dom example compiles on my machine. I will enable ldc 1.19.0 on the CI as well. See what happens there. What platform are you on? Windows?

Ezneh commented 4 years ago

Yes, I am on Windows 10.

Ezneh commented 4 years ago

Alright, it seems I was still on version 0.1.13. Now with latest beta version, the error is "Error: unrecognized file extension obj"

skoppe commented 4 years ago

Call dub with --combined. See https://github.com/skoppe/spasm/issues/15 for backstory.

Ezneh commented 4 years ago

Alright, it seems I then have the same issues referred there (with the optional/test time_t / wchar_t. I guess this is something that needs to be resolved elsewhere. I will try to test on Linux / WSL in the meantime.