Author Topic: OS X/Linux/Unix/etc Compatibility  (Read 7773 times)

Pueo

  • Rogueliker
  • ***
  • Posts: 263
  • Karma: +0/-0
    • View Profile
    • Email
OS X/Linux/Unix/etc Compatibility
« on: March 22, 2012, 03:20:50 PM »
If I make an executable on OS X, will all those other Unix-likes be able to run the .exe?  I know OSX is based on Darwin, so it's in the Unix family, but I'm not sure how compatible it is with the other guys.  I know I can run Unix .exes, but I don't know if other Unix systems can run OS X .exes.
{O.o}
 |)__)
   ” ”   o RLY?

Tapio

  • Newcomer
  • Posts: 46
  • Karma: +2/-1
    • View Profile
    • Email
Re: OS X/Linux/Unix/etc Compatibility
« Reply #1 on: March 22, 2012, 08:37:33 PM »
Short answer: No.

(Also, .exe is a Windows executable file, nothing to do with unixes).

El Barto

  • Newcomer
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: OS X/Linux/Unix/etc Compatibility
« Reply #2 on: March 23, 2012, 11:53:56 AM »
A bit longer answer:
Not on linux for sure, because, for some reason, the endianess of the binaries on those two platform are different.
I'm not sure on *BSD...

BTW, on *NIX a file extension is not necessary :) It uses other tricks to know which files it can run (the permissions).
You could add the suffix .exe, if you so desire, but the file doesn't magically turn itself into a windows executable...

edit: you could try and cross-compile, but perhaps releasing the source and let anyone who is interested in to compile it on his/her own is perhaps the better solution, PROVIDED that you are using multiplatform libraries, better yet if free :)
A *NIX user is supposed to be savvy enough to know how to compile something, anyway :p
« Last Edit: March 23, 2012, 12:04:14 PM by El Barto »

kraflab

  • Rogueliker
  • ***
  • Posts: 454
  • Karma: +0/-0
    • View Profile
    • kraflab.com
Re: OS X/Linux/Unix/etc Compatibility
« Reply #3 on: March 23, 2012, 04:33:56 PM »
I've seen people write programs that can compile certain languages into windows exes from os x, but I personally don't know how that works.

It's pretty easy (and especially free) to run a virtual machine on your computer and put linux (or anything else) on it.  My computer is pretty old but I was still able to pull that off.  I only did it with linux though.  If you virtualize an os that isn't as compact as linux it might require more space/a good computer.
« Last Edit: March 23, 2012, 04:36:14 PM by kraflab »

Pueo

  • Rogueliker
  • ***
  • Posts: 263
  • Karma: +0/-0
    • View Profile
    • Email
Re: OS X/Linux/Unix/etc Compatibility
« Reply #4 on: March 26, 2012, 09:34:35 PM »
Short answer: No.

(Also, .exe is a Windows executable file, nothing to do with unixes).
Thanks.

Also, I was just using .exe as a name for any general executable file. I guess that might have caused some confusion.

perhaps releasing the source and let anyone who is interested in to compile it on his/her own is perhaps the better solution, PROVIDED that you are using multiplatform libraries, better yet if free :)
A *NIX user is supposed to be savvy enough to know how to compile something, anyway :p
I had though about releasing the source, but I figured it would be easier for me to be able to compile it all and make sure everything works beforehand.

I'm using ncurses, which I'm pretty sure is not supported on Windows, but I've looked at things like mingw, cygwin, and PDCurses.  Would any of those be helpful?
« Last Edit: March 26, 2012, 10:13:00 PM by Pueo »
{O.o}
 |)__)
   ” ”   o RLY?

Tapio

  • Newcomer
  • Posts: 46
  • Karma: +2/-1
    • View Profile
    • Email
Re: OS X/Linux/Unix/etc Compatibility
« Reply #5 on: March 27, 2012, 10:00:27 AM »
I'm using ncurses, which I'm pretty sure is not supported on Windows, but I've looked at things like mingw, cygwin, and PDCurses.  Would any of those be helpful?
It depends. If you don't use exotic / ncurses-only features, PDCurses should allow you to compile your game for Windows without changes. I did my 2010 7DRL with ncurses, and trivially ported it to Windows using PDCurses.

In fact, I cross-compiled the Windows exe from Linux. Simple programs are very easy to cross-compile to Windows, as long as you don't use any Linux/OSX system APIs. You just need a cross-compiler, which in most Linux distributions is installable from repositories with one command/click. However, I don't know about OSX.

Pueo

  • Rogueliker
  • ***
  • Posts: 263
  • Karma: +0/-0
    • View Profile
    • Email
Re: OS X/Linux/Unix/etc Compatibility
« Reply #6 on: March 27, 2012, 04:34:07 PM »
It depends. If you don't use exotic / ncurses-only features, PDCurses should allow you to compile your game for Windows without changes. I did my 2010 7DRL with ncurses, and trivially ported it to Windows using PDCurses.

In fact, I cross-compiled the Windows exe from Linux. Simple programs are very easy to cross-compile to Windows, as long as you don't use any Linux/OSX system APIs. You just need a cross-compiler, which in most Linux distributions is installable from repositories with one command/click. However, I don't know about OSX.

Thanks, I'll look at a cross-compiler as well. 
{O.o}
 |)__)
   ” ”   o RLY?