Jump to content

Creating an .EXE?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Kuroachia

Kuroachia

    Newbie

  • Members
  • Pip
  • 3 posts
Hello all~!

I am currently in a C programming course which has taught me a fair share of the basics in C and I am very quickly learning that I absolutely LOVE programming, but in any case: I have been curious about getting a little more "advanced" in my programming and the question I have makes me rather bashful because I feel the answer is probably something as simple as "Use the right compiler".

For my Final Grade in the class I have to program the game Mastermind (or Bulls and Cows if you know it by this name?) which isn't what I'm asking for help with actually, what I am wanting to know is how do I create a Windows executable with my finished product? There's no GUI to my game, it's a simple text-based adoption of the good ol' fashioned Mastermind and I would like to be able to share this with some friends, family, and the like who don't natively run Linux as I do.

See the thing is in order to turn in all of our assignments up to this point in the year we have had to SSH into the department Unix server so the professor and the T.A.'s compile everything from there and actually all of the programming I have done thus far has been from Ubuntu so when I personally compile and run the code from my OS it works great, naturally; what I wanted to know is how do I go about compiling something such that there is a simple executable file that I can open up on a windows box to play?

I have been looking around online and haven't found anything with Google (pertaining to C at least) that could help me, I did however stumble upon CodeCall which has had a breadth of other extremely useful information so I thought maybe I'd try here for help with this question?

#2
gech

gech

    Newbie

  • Members
  • Pip
  • 1 posts
Nice code!!!!!!!!!!!

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Both C and C++ are designed to work on ANY platform, including many where the concept of a monitor doesn't make sense. As a result, they do not include any facilities for graphics.

That said, there are a number of libraries (mainly for C++, but check out GTK for C) that were designed specifically to provide GUI interfaces to those languages. If you are using Ubuntu with Gnome, then you have already seen dozens of programs written in GTK. If you use KDE, you've seen applications written using the QT toolkit.

The one thing to be aware of is that these toolkits/libraries are BIG. I have seen books on wxWidgets, QT, and GTK... each as big as a standard book on C or C++.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
CPD

CPD

    Learning Programmer

  • Members
  • PipPipPip
  • 57 posts

Quote

what I wanted to know is how do I go about compiling something such that there is a simple executable file that I can open up on a windows box to play?
Really the only two ways are using a cross compiler where the target system is different from the development system, or just going to a Windows box and compiling your code there. I don't know of any Linux<->Windows cross compilers, so you might be stuck with compiling from a Windows machine and distributing that executable.

#5
Kuroachia

Kuroachia

    Newbie

  • Members
  • Pip
  • 3 posts
I appreciate the information WingedPanther but it wasn't quite what I was asking heh, I'm not looking at making any sort of GUI because that's still a little above my abilities I think but I will take your word when I am ready for such endeavors.

CPD--Thank you, but this does lead me to another question that is perhaps equally as silly; If anyone knows of any cross compilers do pass it on but until we stumble upon that knowledge can anyone recommend a small C compiler for windows then? I'll still be writing everything from my Linux box so I won't need an entire IDE on the windows box heh.

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
MinGW is GCC ported to Windows.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#7
Kuroachia

Kuroachia

    Newbie

  • Members
  • Pip
  • 3 posts
Perfect thanks!!! I really appreciate the help!