My host is Ubuntu 20.04(x86_64) and my PC is Windows 10 Home (64-bit operating system, x64-based processor). I want to build a dart server to a single file. So, I used this command
dart compile exe dart_server/bin/dart_server.dart -o dart_server-linux-x64
to build the dart_server-linux-x64
file and move it to the host.
and run this file by
./dart_server-linux-x64
Then I got the error:
-bash: ./dart_server-linux-x64: cannot execute binary file: Exec format error
How to solve that? I tried uploading the folder project(dart_server). Then run this dart server from this folder and it works successfully. But I want to use a single file, not the whole folder project. How to fix that?