Problems creating linux executable from c # source code using mkbundle

As mentioned in this thread, and also here I use mkbundle -o newfile oldfile.exe --static (OS: Ubuntu 11.10 64bit, Mono: 2.10.5) to create a file that must be executed on the Apache web server (OS: Debian GNU / Linux 32bit). Here oldfile.exe was the result of compiling C # -Hello-World-Code using mcs oldfile.cs . On the source system (with Ubuntu), the file is executable. However, when I call newfile on the Apache web server, I get an error:

cannot execute binary

Also when executing file newfile it says

ELF 64-bit LSB executable, x86-64 version 1 (SYSV), dynamically linked (uses shared libraries), does not strip

I suspect mkbundle worked as intended, then it should have read

... statically linked ...

Is not it? Any idea why the file is not executable on the server? Is this a 32bit / 64bit issue?

+4
source share
1 answer

mkbundle from 64-bit Mono generates 64-bit executables, and you cannot run a 64-bit executable on a 32-bit kernel. Since mkbundle not able to generate 32-bit binaries, you apparently need to generate your executable with 32-bit Mono (theoretically you can install 32-bit Mono on your 64-bit system, but it’s not so easy I suggest installing a 32-bit system somewhere, possibly in VM).

+7
source

Source: https://habr.com/ru/post/1395614/


All Articles