2

Possible Duplicate:
Howto compile for Windows on Linux with gcc / g++?

We don't have windows here how can I compile this program for some ppl? Is there some kinda Wine for linux programs to run on windows or what.

Community
  • 1
  • 1
user1139252
  • 261
  • 5
  • 11
  • Downvoting this was wrong by whoever did it, it's a perfectly valid question. And the answer is cross-compiling with mingw. I don't have enough reputation to answer within 3 minutes... – Tobias Feb 11 '12 at 20:19
  • Usually, it's just better to distribute source code. Plus, it's funny to watch Windows users struggling to get things to compile on "Visual C++" ;) – aviraldg Feb 11 '12 at 20:23
  • 7
    @Aviral Dasgupta : `Usually, it's just better to distribute source code. Plus, it's funny to watch Windows users struggling to get things to compile on "Visual C++" ;) – Aviral Dasgupta` : This is one of the most childish comments I saw on StackOverflow. And I'm not even counting the clueless remark about the reality of the difficulty to compile on Visual C++, or the fact your comment doesn't help the question author whatsoever. Congrats. – paercebal Feb 11 '12 at 20:29
  • @paercebal That's why it's a comment and not an answer. I'm talking about generic written-for-linux programs. – aviraldg Feb 11 '12 at 20:34
  • 2
    @Tobias - I wasn't the first person to down vote, but I did downvote because it shows little research effort - the top 4 hits for "linux build for windows" on google were all relevant and helpful. – Flexo Feb 11 '12 at 23:35

1 Answers1

6

You can use cross-compiler gcc-mingw

I did not use it myself and about it only theoretically.

mikithskegg
  • 806
  • 6
  • 10
  • oh this is a Qt app i think it may use gcc-mingw natively? I just drop a .exe on the output program and distribute mingw dll with it? – user1139252 Feb 11 '12 at 20:29
  • 1
    @user1139252 You need a [cross-compiler](http://en.wikipedia.org/wiki/Cross_compiler). A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is run. – David Heffernan Feb 11 '12 at 20:34