AbSaintDane
AbSaintDane

Reputation: 77

Compiling for 32 Bit Windows (C++)

I wrote a very simple calculator program in C++ in the IDE DEV-C++.

The code was fine as it compiled alright and ran like it was supposed to, but when I sent it over Skype to a friend he couldn't run it because his machine ran 32-bit Windows, and DEV-C++ compiled my program for 64-bit.

How would I go about compiling it for 32-bit Windows? Do I just need to download the 32-bit version of DEV-C++? If so, can someone link me to it? I looked on their site and I can't find it.

Otherwise how else may I compile it for 32-bit Windows?

UPDATE: I just found an option under "Compiler Options" in Dev-C++ that gives a list with options like so:

http://prntscr.com/30xts8

Could that be it?

Upvotes: 1

Views: 5149

Answers (1)

Liam M
Liam M

Reputation: 5432

You've hit upon the answer: you need to tell the compiler to build code for the correct platform. You can do that by selecting 'TDM-GCC 4.8.1 32-bit Release' from that list and recompiling your application.

The three options given for 32-bit and 64-bit (Release, Debug and Profiling), should be used in different circumstances:

  • Debug: should be selected when you're working on your code and want to use a debugger. The compiler will add 'debug symbols', to the executable that a debugger (such as GDB), can identify and use to give you meaningful error messages.
  • Release: builds an application suitable for you to send to your customers, or your friend.
  • Profiling: builds an application suitable for use with a profiler.

Upvotes: 3

Related Questions