Hi snakes,
i am running cobra on linux and mono.
When i compile with -c a .exe file is created on the linux machine.
Suppose this will normally run under Windows and Mono.
So how is it possible to compile a linux executable ?
Best Regards
Achletomeniak
PS. Of course i wish a good slide into new year 2018 !
Forums
I am still active no matter whatever.
5 posts
• Page 1 of 1
Re: I am still active no matter whatever.
Last night was my first foray into Mono on Linux, and I was surprised by the .exe as well. As a quick solution, you can execute myprog.exe with "mono myprog.exe". I don't know if there are slicker direct options or not.
Things I would wonder about:
1. Could make a script that just said "mono myprog.exe" in it. (apologies if the following is obvious, but it might not be for someone else who finds this post and is coming from the Windows world) Call that script "myprog" and then do "chmod u+x myprog" and then it can run as the program (of course, for security, the local directory is probably not on your executable path, so you'd have to use "./myprog" instead of just "myprog")
2. Linux supports executable file format loaders. For example, I know that Wine can be set up so that attempting to execute a Windows .exe (PE32 format) will launch it under Wine. It should be possible to configure that system to recognize .NET executable formats and run them through Mono, but I've never attempted such a thing. I wouldn't think that I'm the only person to consider this, so there may be web resources. I also don't know how hard it would be to differentiate the .NET executable format (which I'm sure is a subtype of PE32) from "generic Win32 PE32" format.
Things I would wonder about:
1. Could make a script that just said "mono myprog.exe" in it. (apologies if the following is obvious, but it might not be for someone else who finds this post and is coming from the Windows world) Call that script "myprog" and then do "chmod u+x myprog" and then it can run as the program (of course, for security, the local directory is probably not on your executable path, so you'd have to use "./myprog" instead of just "myprog")
2. Linux supports executable file format loaders. For example, I know that Wine can be set up so that attempting to execute a Windows .exe (PE32 format) will launch it under Wine. It should be possible to configure that system to recognize .NET executable formats and run them through Mono, but I've never attempted such a thing. I wouldn't think that I'm the only person to consider this, so there may be web resources. I also don't know how hard it would be to differentiate the .NET executable format (which I'm sure is a subtype of PE32) from "generic Win32 PE32" format.
- DigitalMonk
- Posts: 1
Re: I am still active no matter whatever.
I normally just make a small shell script in the same directory like so:
But if you really want that linux executable, Mono has a tool to do that called mkbundle[2] as this gentleman discovered:
https://unix.stackexchange.com/a/36530
See also:
http://www.mono-project.com/archived/gu ... s/#bundles
- Code: Select all
#!/bin/sh
exec mono --debug `dirname $0`/my.exe "$@"
But if you really want that linux executable, Mono has a tool to do that called mkbundle[2] as this gentleman discovered:
https://unix.stackexchange.com/a/36530
See also:
http://www.mono-project.com/archived/gu ... s/#bundles
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: I am still active no matter whatever.
Thank you very much for this informations charles.
Of course i am familiarized with linux shell programming and AWK.
I will check out the bundle option too.
It's a cool thing.
Of course i am familiarized with linux shell programming and AWK.
I will check out the bundle option too.
It's a cool thing.
- Achletomeniak
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 12 guests