Author Topic: how to set up a windows/linux C++ cross-compiler on linux?  (Read 2665 times)

0 Members and 1 Guest are viewing this topic.

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
I am interested in compiling my C++ games for windows for obvious reasons, but do not have a computer that runs windows. I do have a backup of an image of xp for use with a virtual machine but I would rather not use windows at all if it can be avoided. I know that it is possible to compile a windows executable (such as mingw with wine?) but I don't know the details for setting a system up to do it. I know what needs to be changed in the code itself for it to work on windows, I just need to know how to compile a windows executable from a linux pc. Can anyone here help me?  :-X
« Last Edit: May 09, 2011, 08:18:21 pm by miotatsu »

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: how to set up a windows/linux C++ cross-compiler on linux?
« Reply #1 on: May 09, 2011, 08:22:01 pm »
winegcc, winebuild and stuff like that came with my wine installation.

So I guess winegcc works exactly like gcc for linux in command line, you just have to specify CC=winegcc CPP=wineg++ or something.

EDIT:
Code: (bash) [Select]
julien@amy:~$ wineg++ --version
g++ (GCC) 4.6.0 20110429 (prerelease)
Copyright © 2011 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a PAS
GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.
:D
« Last Edit: May 09, 2011, 08:23:01 pm by juju2143 »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline miotatsu

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 332
  • Rating: +11/-1
    • View Profile
Re: how to set up a windows/linux C++ cross-compiler on linux?
« Reply #2 on: May 09, 2011, 08:24:18 pm »
hm I will look into it :O
that is not what I was looking for

edit: found this http://www.jonshouse.co.uk/linuxmingw.cgi
« Last Edit: May 09, 2011, 08:40:51 pm by miotatsu »

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: how to set up a windows/linux C++ cross-compiler on linux?
« Reply #3 on: May 09, 2011, 10:13:58 pm »
Debian includes the mingw32 cross compiler; it works fine in my experience.  (Actually, it includes both "mingw32" and "gcc-mingw32" - I don't really know what the difference is, apart from politics.)  You can also build your own, which is easier than you might think.