3

I'm going to start learning how to program applications for Windows. I'm not sure what compiler I should use. Right now I'm using the Code::Blocks IDE 10.5 and got used to it and would like to stick to it.

I don't know if I should use the GNU GCC compiler or the MSVC++ 2008 compiler. Is there any reason to pick one over the other when creating a Win32 GUI project?

And how can I tell the compiler/linker to look in the Windows SDK directory instead of it's own directory?

R. Martinho Fernandes
  • 228,013
  • 71
  • 433
  • 510

4 Answers4

7

You can use any of those with Code::Blocks. Pick the one you like the most. As for telling the tools about the Windows SDK, right-click your project and pick "Build options...":

The Build options dialog

Add <SDKPath>\include (C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include on my machine) to the compiler directories, and to linker directories add <SDKPath>\lib (C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib on my machine)

R. Martinho Fernandes
  • 228,013
  • 71
  • 433
  • 510
  • 1
    If you run into trouble with MinGW, try the -mwindows flag suggested in [this answer](http://stackoverflow.com/questions/2022112/can-g-mingw-play-nice-with-the-windows-sdk-is-visual-studio-the-only-option/2022130#2022130). – R. Martinho Fernandes May 15 '11 at 09:02
1

+1 to Visual Studio. You'll handly find anything better than this for Windows. You can also use comand line gcc / g++ from Cygwin console, but I still use VS as the code editor. You'll get VS2008 Express for free here:

http://www.microsoft.com/express/Downloads/

Tomasz Kowalczyk
  • 10,472
  • 6
  • 52
  • 68
0

For Win32 programs (and particularly GUI ones) I feel Visual Studio is a good choice. Sure, it has its share of shortcomings, but its quite good as a whole. Moreover you can pick up a free (and limited capability) copy of it from here.

BiGYaN
  • 6,974
  • 5
  • 30
  • 43
0

I would agree with what most others are saying and would use Visual Studio. As pointed out the express version is free, but if you are a student you should look at the Microsoft DreamSpark program.

daalbert
  • 1,465
  • 9
  • 7