Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Is it possible to compile for Mac/Linux using MS Visual Studio?  (Read 2474 times)

0 Members and 1 Guest are viewing this topic.

smguyk

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Is it possible to compile for Mac/Linux using MS Visual Studio or any other compiler on Windows?

I don't have Mac or Linux but want my game for those platforms too
« Last Edit: May 21, 2014, 09:33:33 am by smguyk »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Is it possible to compile for Mac/Linux using MS Visual Studio?
« Reply #1 on: May 21, 2014, 09:55:14 am »
You'll need a cross-compiler (i.e. a compiler that runs on Windows, but which produces executables in Linux / OS X format), as well as all the dependencies that SFML uses. You should be able to find a toolchain based on gcc, but I'm pretty sure you won't be able to compile for OS X.

Note that this is the hard way. It's much easier to setup a virtual machine and compile natively. Again, you'll have problems with OS X (virtualizing OS X works if you have the hardware, but it's illegal), so you'd better ask someone who owns a Mac to compile it for you.
Laurent Gomila - SFML developer

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Is it possible to compile for Mac/Linux using MS Visual Studio?
« Reply #2 on: May 21, 2014, 09:58:31 am »
Cross compilers do exist.
But even if you get that running, how would you test?
Path of least resistance is IMHO to just install Linux in a VM an build/test there. Then go buy the cheapest Mac mini you can find and build/test on that.
Not really worth the time/effort to do anything else...

smguyk

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Re: Is it possible to compile for Mac/Linux using MS Visual Studio?
« Reply #3 on: May 21, 2014, 01:09:45 pm »
Thanks guys.

I'll go with the VM for Linux then, and ditch Mac entirely

select_this

  • Full Member
  • ***
  • Posts: 130
  • Current mood: just ate a pinecone
    • View Profile
    • darrenferrie.com
Re: Is it possible to compile for Mac/Linux using MS Visual Studio?
« Reply #4 on: May 21, 2014, 01:24:02 pm »
Ubuntu provides a bootloader that allows dual booting of Windows and Ubuntu on the same system, if you prefer (and have the disk space). Not sure if there are other distros that do similar.
Follow me on Twitter, why don'tcha? @select_this

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Is it possible to compile for Mac/Linux using MS Visual Studio?
« Reply #5 on: May 21, 2014, 01:43:10 pm »
Vm does not work so well as far as I am concerned. The render window displays only a black square on Linux hosts win7 virtualized via virtual box)
@dwarfman78
github.com/dwarfman78

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Is it possible to compile for Mac/Linux using MS Visual Studio?
« Reply #6 on: May 21, 2014, 03:54:20 pm »
Quote
Vm does not work so well as far as I am concerned.
It works well for many others, including me.
Laurent Gomila - SFML developer

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Is it possible to compile for Mac/Linux using MS Visual Studio?
« Reply #7 on: May 21, 2014, 08:42:36 pm »
I'm using a Linux host with various VirtualBox VMs running Win7 and various other Linux distros than the host and I have no problems testing my SFML code in those VMs - some use 3D acceleration/passthrough and some just use software rendering via Mesa, but my applications run just fine in all of them. So yeah, using VMs for this sort of thing is definitely possible.

 

anything