Question

As mentioned in this thread as well as here I am using mkbundle -o newfile oldfile.exe --static (OS: Ubuntu 11.10 64bit, Mono: 2.10.5) to create a file which shall be executable on an Apache Web Server (OS: Debian GNU/Linux 32bit). Here, the oldfile.exe was the result of the compilation of a C#-Hello-World-Code using mcs oldfile.cs. On the original system (with Ubuntu) the file is executable. However, whenver I call newfile on the Apache Web Server I get the error:

cannot execute binary file

Also, when doing file newfile it says

ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped

I suspect if mkbundle worked as it is supposed to, then it should have read

... statically linked ...

shouldn't it? Anyone an idea why the file is not executable on the Server? Is it a problem because of 32bit/64bit?

Was it helpful?

Solution

mkbundle from 64-bit Mono generates 64-bit executables and you cannot run a 64-bit executable on 32-bit kernel. As mkbundle doesn't have an option 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 that is not very easy so I suggest installing a 32-bit system somewhere, maybe in VM).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top