It’s possible to compile the Delphi source files with the web assembly compiler from Oxygene? I’m trying to do this, but isn’t working.
Depends on the source and what APIs you use. On the language level, all Oxygene code can be compiled for WebAssembly, so in theory all Delpi code (aside from the very small subset where there are incompatibilities – which we are working on) should, as well.
Of course WebAssemnkly is a different platform so the APIs that are available to your code to call are different – you’ll have Island RTL, Elements RTL as well as the Browser DOM & related. You will not e.g. have the Delphi VCL or other libraries that come with Delphi, as these are not available for WebAssembly.
It would be helpful to know more about what you’re trying and how it fails, in order to diagnose what the problem is, here.
—marc
A very simple example I’m trying to compile the System.SysUtils unit from Delphi and the compiler show this errors to me:
E: Reference file gc.fx has platform "WebAssembly", should be "Windows"
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (92)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (92)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (92)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (95)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (95)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (95)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (115)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (115)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (115)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (116)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (116)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (116)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (117)]
E: equals (=) expected, got "deprecated" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (117)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (119)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (119)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (119)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (121)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (121)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (121)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (122)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (122)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (122)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (123)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (123)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (123)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (124)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (124)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (124)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (125)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (125)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (125)]
E: colon (:) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (205)]
Thanx.
E: Reference file gc.fx has platform “WebAssembly”, should be “Windows”
This one is curious. Is your project type Windows or WebAssembly? It seems you’re referencing the WebAssembly version of this library (good, if you want to build for WebAssembly), but somehow the compile rthings its building for Windows. Can i see the project (just the .elements is fine, if you don’t want to/cannot share the code).
E: semicolon (
expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (92)]
E: equals (=) expected, got semicolon ([C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (92)]
It seems these come from the use of the platform keyword, which will work, but only if Delphi Compatibility Mode is turned on for the project (it looks like it’s not, given that platform doesn’t highlight as a keyword. Can you check that?
Also for clarity, are you using the very latest version, .3071?
thanx,
marc
This one is curious. Is your project type Windows or WebAssembly? It seems you’re referencing the WebAssembly version of this library (good, if you want to build for WebAssembly), but somehow the compile rthings its building for Windows. Can i see the project (just the
.elementsis fine, if you don’t want to/cannot share the code).
Yes, I created a project of WASM type.
It seems these come from the use of the
platformkeyword, which will work, but only if Delphi Compatibility Mode is turned on for the project (it looks like it’s not, given thatplatformdoesn’t highlight as a keyword. Can you check that?
Activated the Delphi Compability mode and the error changed:
"C:\Program Files (x86)\RemObjects Software\Elements\Bin\EBuild.exe" --logger:fire "D:\Projetos\Testes\WASM Oxygen\Oxygen\Oxygen.sln" --configuration:Debug --build --setting:TreatFixableErrorsAsWarnings=True "--xml:D:\Projetos\Testes\WASM Oxygen\Oxygen\obj\Oxygen.water.xml" --no-goal --setting:fbeeb2ce-d638-408b-900b-512da75445cc,DesiredDefaultArchitecture=x86_64 --setting:72637679-909c-4b0b-b76c-42e7ee65d767,DesiredDefaultArchitecture=wasm32 --verbosity:normal
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2026. All Rights Reserved. Created by marc hoffman.
Running natively on Windows x86_64.
Version 12.0.0.3071 (develop) built on bajor, 20260404-142058. Commit 3d8c3fc.
No exact Windows SDK version was specified for target 'Island-Windows', using 'Windows 10.0.22000.0'.
Reference 'gc' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\WebAssembly\wasm32\gc.fx' via 'HintPath' for target 'Island-Windows'.
Reference 'gc' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\WebAssembly\wasm32\gc.fx' for target 'Island-Windows' (x86_64).
Reference 'Island' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Island.fx' for target 'Island-Windows'.
Reference 'Island' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Island.fx' for target 'Island-Windows' (x86_64).
Reference 'rtl' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\x86_64\rtl.fx' for target 'Island-Windows'.
Reference 'rtl' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\x86_64\rtl.fx' for target 'Island-Windows' (x86_64).
Reference 'Elements' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Elements.fx' for target 'Island-Windows'.
Reference 'Elements' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Elements.fx' for target 'Island-Windows' (x86_64).
Reference 'IslandMath' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\IslandMath.fx' for target 'Island-Windows'.
Reference 'IslandMath' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\IslandMath.fx' for target 'Island-Windows' (x86_64).
E: Reference file gc.fx has platform "WebAssembly", should be "Windows"
W: Variable without a prefix preceded by a class var will be static too [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (452)]
W: Variable without a prefix preceded by a class var will be static too [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (455)]
E: {$ENDIF} expected, got procedure [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (705)]
E: No matching $IFDEF for $ENDIF [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (707)]
E: {$ENDIF} expected, got ; [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (725)]
E: semicolon (;) expected, got define [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (725)]
E: "implementation" or interface section members (types or methods) expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (728)]
E: {$ENDIF} expected, got 1024 [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (728)]
C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas(728,6): duplicate-error E3: "implementation" or interface section members (types or methods) expected
E: {$ENDIF} expected, got ; [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (1044)]
E: semicolon (;) expected, got define [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (1044)]
E: No matching $IFDEF for $ELSE [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (1044)]
E: "implementation" or interface section members (types or methods) expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (1044)]
E: semicolon (;) or close parenthesis expected, got define [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (1316)]
E: colon (:) expected, got close parenthesis [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (1316)]
E: semicolon (;) expected, got close parenthesis [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (1316)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2242)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2244)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2324)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2326)]
E: semicolon (;) expected, got define [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2377)]
E: {$ENDIF} expected, got + [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2377)]
E: "implementation" or interface section members (types or methods) expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2377)]
E: semicolon (;) expected, got define [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2671)]
E: semicolon (;) expected, got define [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2672)]
E: Unexpected semicolon found [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2672)]
E: semicolon (;) expected, got define [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2674)]
E: semicolon (;) expected, got define [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2675)]
E: Unexpected semicolon found [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2675)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2718)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3080)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3082)]
E: identifier expected, got "module" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3183)]
E: identifier expected, got "module" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3190)]
E: identifier expected, got "module" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3216)]
E: {$ENDIF} expected, got ; [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3494)]
E: semicolon (;) expected, got define [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3494)]
E: No matching $IFDEF for $ENDIF [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3494)]
E: Invalid attribute type; only regular types allowed for attributes [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3495)]
Also for clarity, are you using the very latest version, .3071?
Is this the build I’m using.
Thanks for the reply!
Can you try enabling the Legacy Macro Processor setting, as well?
I created a new solution and I’m trying to compile a Windows solution. But erros continues.
Can you try enabling the Legacy Macro Processor setting, as well?
Activating the legacy macro processor works, but the “WINDOWS” macro doesn’t extist.
"C:\Program Files (x86)\RemObjects Software\Elements\Bin\EBuild.exe" --logger:fire "D:\Projetos\Testes\Windows Oxygen\ConsoleApplication\ConsoleApplication.sln" --configuration:Debug --build --setting:TreatFixableErrorsAsWarnings=True "--xml:D:\Projetos\Testes\Windows Oxygen\ConsoleApplication\obj\ConsoleApplication.water.xml" --no-goal --setting:3dddf316-cc6b-4daf-90b6-9a66cc43943f,DesiredDefaultArchitecture=x86_64 --verbosity:normal
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2026. All Rights Reserved. Created by marc hoffman.
Running natively on Windows x86_64.
Version 12.0.0.3071 (develop) built on bajor, 20260404-142058. Commit 3d8c3fc.
No exact Windows SDK version was specified for target 'Island-Windows', using 'Windows 10.0.22000.0'.
Reference 'gc' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\x86_64\gc.fx' for target 'Island-Windows'.
Reference 'gc' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\x86_64\gc.fx' for target 'Island-Windows' (x86_64).
Reference 'Island' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Island.fx' for target 'Island-Windows'.
Reference 'Island' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Island.fx' for target 'Island-Windows' (x86_64).
Reference 'rtl' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\x86_64\rtl.fx' for target 'Island-Windows'.
Reference 'rtl' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\x86_64\rtl.fx' for target 'Island-Windows' (x86_64).
Reference 'Elements' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Elements.fx' for target 'Island-Windows'.
Reference 'Elements' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Elements.fx' for target 'Island-Windows' (x86_64).
Reference 'IslandMath' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\IslandMath.fx' for target 'Island-Windows'.
Reference 'IslandMath' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\IslandMath.fx' for target 'Island-Windows' (x86_64).
W: Legacy preprocessor paused for 1095ms waiting for references (evaluating SizeOf(Extended)). Switch to the modern preprocessor if possible
W: Unknown compiler directive: WEAKPACKAGEUNIT [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (18)]
W: Variable without a prefix preceded by a class var will be static too [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (452)]
W: Variable without a prefix preceded by a class var will be static too [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (455)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (735)]
E: semicolon (;) expected, got "var" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (723)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (1319)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2242)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2244)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2324)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2326)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (2718)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3080)]
E: identifier expected, got "result" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3082)]
E: identifier expected, got "module" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3216)]
E: colon (:) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: "begin" expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: semicolon (;) expected, got identifier [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: equals (=) expected, got open parenthesis [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: semicolon (;) expected, got "const" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: equals (=) expected, got semicolon (;) [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3499)]
E: equals (=) expected, got close parenthesis [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3500)]
E: Expression expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3500)]
E: semicolon (;) expected, got close parenthesis [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3500)]
E: "implementation" or interface section members (types or methods) expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (3500)]
E: identifier expected, got "old" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4019)]
E: identifier expected, got "new" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4019)]
E: semicolon (;) or close parenthesis expected, got "new" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4019)]
E: colon (:) expected, got close parenthesis [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4019)]
E: semicolon (;) expected, got close parenthesis [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4019)]
E: identifier expected, got "false" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4734)]
E: semicolon (;) expected, got "false" [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4734)]
E: "implementation" or interface section members (types or methods) expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4734)]
E: "implementation" or interface section members (types or methods) expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4742)]
E: "class" modifier not allowed on global methods [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4742)]
E: "implementation" or interface section members (types or methods) expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4743)]
E: "class" modifier not allowed on global methods [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4743)]
E: "implementation" or interface section members (types or methods) expected [C:\Program Files (x86)\Embarcadero\Studio\37.0\source\rtl\sys\System.SysUtils.pas (4744)]
It’s still confused aboutr WebAssembkly vs Windows. i really need tp see the project to sat more, this should not happen (and i cannot reproduce it lcoally with a new WebAssembly project from template – builds fine). So i need to see what changes you made trigger this inconsistency. ![]()
It’s a very simple project.
ConsoleApplication.zip (1.9 KB)
What’s a windos project:
Reference 'gc' was resolved to '/Users/mh/Code/RemObjects/Elements/Bin/Island SDKs/Windows/Windows 10.0.22000.0/arm64/gc.fx' for target 'Island-Windows'.
The question is, how did it getb there (if you started from the WebAssembly template), and why does it still try to use the WebAssembly version of gc.fx…
Can you set the Build verbsity to Diagostic in Tools|Options:
Build again and send me the full build log? After that, try a “Clean” (Control_Shift_K) and then build again, and see if the gc.fx error goes away…
Update: nevermind, if that error is already gone now.
I created a new solution and I’m trying to compile a Windows solution. But erros continues.
I created a new solution.
Log.txt (215.0 KB)
Yeah, thats a Windows project:
D: - <SubMode = Windows [Target: Island-Windows]>
Do note that Embarcadero’s SysUtils.pas is not something that is supposed to compile (as of yet). To use Delphi libraries, import their packages as desxcribed here: Using Delphi Packages and here: Island/Delphi: Using Delphi APIs from Elements.
Let me explain what I’m trying to do.
My goal is to compile FMX to WebAssembly. However, as stated in your documentation, it only compiles to the operating systems supported by Embarcadero. With that in mind, I can’t use this approach to compile the project to WASM.
So I decided to try compiling the FMX source code directly to WASM. Of course, there will be missing parts that Embarcadero hasn’t implemented for WASM — I plan to fill in those gaps myself so the project can run.
When I opened this discussion, I created a WebAssembly project and tried compiling System.SysUtils. But I quickly realized that wouldn’t work, so I switched the project to Windows to try compiling the Delphi sources instead — just to confirm that I could get them to compile at all.
That’s why this discussion ended up being a bit confusing.
So here’s the question: would I be able to compile the FMX sources to WASM using Oxygen?
Yes. Unless youre willing to do the work to port all of Delphi RTL+FMC to WebAssembly yourself (which basically would mean reinventing FMX for an entirely new UI platform - HTML), this is a no-go. This would be a multi-person, multi-year project ![]()
Not unless someone implements FMX for WebAssembly, no. And as I mentioned above. I’d expect this to be a huge effort.
To be clear, our goal in the long run (it’s far from there yet, and it will be a while), is that we will be able to compile almost/all of System/SysUtils/etc in the Oxygene compiler. Even then, someone would have to port all the parts of those base Delphi units to be compatible with WebAssembly, because this layer of Delphi has a lot of platform-specific code that supports only the platforms that Embarcadero supports (e.g. you might, one day, compile SysUtils for Windows at that stage, but not yet for WebAssembly).
Even with that done, FMX still would only know how to render UI using Windows and Cocoa APIs and be useless on WebAssembly without you (or someone) essentially reimplementing FMX for WebAssembly, specifically to render to web/html. That alone would be a tremendous amount of effort.
Long story short, I believe this is a dead end and a no-go.
Your bets option for using Object Pascal for WebAssembly-based HTL web UI is to look at our approach with the WebModule with CodeBehind project template. It works a lot like ASP/ASP.NET did, except browser side, where you have an HTML file (which can contain JavaScript) for your UI, and a .pas file with Oxygene code as “codebehind”; the two forms. pair, and the Oxygene code can interact with the HTML, and vice versa.
Jim and I did a webinar on how this works a few years back that shows you how this works:
Thanks for the reply!
Nice solution in the youtube video too.
But I will try to continue in my path to try to compile the FMX sources.
Changing some configurations in the solution, now the compiler is giving stack overflow error!
ConsoleApplication.zip (2.0 KB)
"C:\Program Files (x86)\RemObjects Software\Elements\Bin\EBuild.exe" --logger:fire "D:\Projetos\Testes\Windows Oxygen\ConsoleApplication\ConsoleApplication.sln" --configuration:Debug --build --setting:TreatFixableErrorsAsWarnings=True "--xml:D:\Projetos\Testes\Windows Oxygen\ConsoleApplication\obj\ConsoleApplication.water.xml" --no-goal --setting:3dddf316-cc6b-4daf-90b6-9a66cc43943f,DesiredDefaultArchitecture=i386 --verbosity:normal
RemObjects EBuild. An open source build engine for Elements and beyond.
Copyright RemObjects Software 2016-2026. All Rights Reserved. Created by marc hoffman.
Running natively on Windows x86_64.
Version 12.0.0.3071 (develop) built on bajor, 20260404-142058. Commit 3d8c3fc.
No exact Windows SDK version was specified for target 'Island-Windows', using 'Windows 10.0.22000.0'.
Reference 'gc' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\i386\gc.fx' for target 'Island-Windows'.
Reference 'gc' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\i386\gc.fx' for target 'Island-Windows' (i386).
Reference 'gc' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\x86_64\gc.fx' for target 'Island-Windows' (x86_64).
Reference 'Island' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\i386\Island.fx' for target 'Island-Windows'.
Reference 'Island' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\i386\Island.fx' for target 'Island-Windows' (i386).
Reference 'Island' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Island.fx' for target 'Island-Windows' (x86_64).
Reference 'rtl' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\i386\rtl.fx' for target 'Island-Windows'.
Reference 'rtl' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\i386\rtl.fx' for target 'Island-Windows' (i386).
Reference 'rtl' was resolved to 'C:\Users\henri\AppData\Local\RemObjects Software\EBuild\SDKs\Island\Windows\Windows 10.0.22000.0\x86_64\rtl.fx' for target 'Island-Windows' (x86_64).
Reference 'Elements' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\i386\Elements.fx' for target 'Island-Windows'.
Reference 'Elements' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\i386\Elements.fx' for target 'Island-Windows' (i386).
Reference 'Elements' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\Elements.fx' for target 'Island-Windows' (x86_64).
Reference 'IslandMath' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\i386\IslandMath.fx' for target 'Island-Windows'.
Reference 'IslandMath' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\i386\IslandMath.fx' for target 'Island-Windows' (i386).
Reference 'IslandMath' was resolved to 'C:\Program Files (x86)\RemObjects Software\Elements\References\Island\Windows\x86_64\IslandMath.fx' for target 'Island-Windows' (x86_64).
Compiling target 'Island-Windows',
W: Legacy preprocessor paused for 1523ms waiting for references (evaluating Declared(AnsiChar)). Switch to the modern preprocessor if possible
W: Legacy preprocessor paused for 1522ms waiting for references (evaluating Declared(AnsiChar)). Switch to the modern preprocessor if possible
W: Legacy preprocessor paused for 1581ms waiting for references (evaluating SizeOf(LongWord)). Switch to the modern preprocessor if possible
W: Legacy preprocessor paused for 1581ms waiting for references (evaluating SizeOf(Extended)). Switch to the modern preprocessor if possible
Process is terminated due to StackOverflowException.
In this solution, it’s compiling the SysUtils unit and the dependencies in this unit.
Thanx!
Cool. Maybe I should put you in direct contact with my colleague @david.millington, who is currently leading the effort to get the compiler more compatible. We’re currently focusing on getting Spring4D to compile, and we already shipped dozens of compatibility tweaks in the past couple of months, if you check the change logs. Whole. unch more coming today in .3073.
Maybe you two can coordinate.
Ouch. will log. That of course should never happen…
Hmm. sadly i cannot reproduce the SO. i added the files from Delphi 31.1.
Unsurprisingly, i get a huge buttload of errors – but no stack overflow…
The first 1000 alone are
function GetCompressedFileSizeW; external kernel32 name 'GetCompressedFileSizeW'; // E1 colon (:) expected, got semicolon (;)
function GetCompressedFileSizeTransacted; external kernel32 name 'GetCompressedFileSizeTransactedW' delayed; // E1 colon (:) expected, got semicolon (;)
// E1 semicolon (;) expected, got identifier
// E4 "end." or implementation section members (types or methods) expected
So i’ve logged that as bugs://E27630
Cool. Maybe I should put you in direct contact with my colleague @david.millington, who is currently leading the effort to get the compiler more compatible. We’re currently focusing on getting Spring4D to compile, and we already shipped dozens of compatibility tweaks in the past couple of months, if you check the change logs. Whole. unch more coming today in .3073.
This will be very nice!
So i’ve logged that as bugs://E27630
Okey!
With the stack overflow erro I’m trying to compile every file alone and this error can put all my project on wait. The error is “case in record not supported”.
unit WASMTest;
interface
type
MyRecord = record
case Integerof
0: (A, B, C: Integer);
1: (X, Y, Z: Byte);
end;
implementation
end.
It’s just a simple unit I’m trying to compile to test the compilier compability.
i only get
unit WASMTest;
interface
type
MyRecord = record
case Integer of // E271 case in record not supported
0: (A, B, C: Integer);
1: (X, Y, Z: Byte);
end;
implementation
end.
Yes, this is the error.





