Forums

I am still active no matter whatever.

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

I am still active no matter whatever.

Postby Achletomeniak » Thu Dec 28, 2017 4:23 pm

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 !
Achletomeniak
 

Re: I am still active no matter whatever.

Postby DigitalMonk » Fri Dec 29, 2017 9:32 am

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.
DigitalMonk
 
Posts: 1

Re: I am still active no matter whatever.

Postby Charles » Sat Dec 30, 2017 11:26 am

I normally just make a small shell script in the same directory like so:
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.

Postby Achletomeniak » Sat Dec 30, 2017 3:40 pm

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.
Achletomeniak
 

Re: I am still active no matter whatever.

Postby Achletomeniak » Sat Dec 30, 2017 3:42 pm

Thank you DIGITALMONK !
Achletomeniak
 


Return to Discussion

Who is online

Users browsing this forum: No registered users and 20 guests