3

I finally was able to successfully install the Windows SDK tools (v.7.1) on my Windows Vista system. I already had the GCC compiler installed and that is what I currently use to compile C code.

Where do I find the documentation for the WinSDK and how should I go about including it in GCC?

I couldn't find any explanations in the release notes or anything. However, if you can find something that explains it, feel free to give me a link.

Warren P
  • 65,725
  • 40
  • 181
  • 316
bgroenks
  • 1,859
  • 5
  • 34
  • 63
  • SO sorry about the answer I posted. When yuo say Win 7.1 I frankly thought WP7.1. As far as Win dev goes, why not use C# or something? Mighty powerful. :) And still, gcc not required -_- – Akshaya Shanbhogue Feb 19 '12 at 02:32
  • What exactly are you trying to do with the SDK? – David Grayson Feb 19 '12 at 02:41
  • @Akshay I've just been using GCC from the beginning... I just think it would be easier for me to continue doing that but include the Win32 APIs. I'm not interested in C#. I already do lots of Java (cough better cough) :D Hehe. But I'm just looking to use the Windows APIs from my current setup. Where do I find the actual documentation of functions and such? – bgroenks Feb 19 '12 at 02:43
  • @DavidGrayson Write C code that utilizes Windows features such as native GUIs and OS operations. – bgroenks Feb 19 '12 at 02:44
  • The Windows SDK documentation is here: http://msdn.microsoft.com/en-us/library/windows/desktop/ff657751.aspx – Cody Gray - on strike Feb 19 '12 at 03:11
  • That's not going to get you very far, though. I recommend purchasing a copy of [Programming Windows](http://www.charlespetzold.com/pw5/) by Charles Petzold. – Cody Gray - on strike Feb 19 '12 at 03:12
  • possible duplicate of [Any Tutorials for Win32 SDK Programming?](http://stackoverflow.com/questions/948686/any-tutorials-for-win32-sdk-programming), [C++ win32 GUI programming, the shortest path?](http://stackoverflow.com/questions/212559/c-win32-gui-programming-the-shortest-path), [A good book to understand WinAPI programming?](http://stackoverflow.com/questions/329776/a-good-book-to-understand-winapi-programming/329789), [Learning the WIN32 API](http://stackoverflow.com/questions/342729/learning-the-win32-api/342740) – Cody Gray - on strike Feb 19 '12 at 03:13
  • 1
    Here's the documentation: http://msdn.microsoft.com/en-us/library/ff818516.aspx I think Cody linked to a subset in an earlier comment. – Ben Voigt Feb 19 '12 at 03:37

1 Answers1

5

This might sound weird to you, but you didn't need to download any separate Windows SDK to develop for Windows, because Visual Studio, and MingW/GCC, and others, already commonly include all that most people would need. (Some people would say, that Visual Studio and other tools, ship with their own version of the SDK, but I think that's merely confusing the issue further.)

You need Visual Studio first. And maybe, some day later, you might want to add the Windows SDK add on to it, but it is not intended to be used by itself, or in combination with GCC. Basically, some of the SDK content duplicates stuff that is already included in Visual C++ and Visual Studio and some of it is additional tools like WinDbg.

Let me explain. The Windows SDK is indeed, useful for doing certain things in Windows that beginners are unlikely to need to do. For example, if you need to integrate with some specialized APIs, the Windows SDK contains a lot of documentation, examples, and a more complete set of header files that weren't included in Visual Studio because they're less frequently used APIs. The core API headers and documentation for Windows are already in Visual Studio, so technically, Visual Studio already contains the core SDK, and the so called SDK is an "auxiliary SDK", or a "low level SDK for purists, advanced users, and certain kinds of systems or native-level programming", but not needed, for most typical end-user applications development.

But if you want to learn Win32 native programming using C or C++, or you just want to write native Windows applications you PROBABLY don't need anything that comes in the SDK, and even then you need Visual Studio first, and the SDK second. Let me explain:

  1. Many tools that let you write pure native Windows applications, provide higher level APIs, including Visual Studio, which gives you MFC or ATL. None of those tools need the SDK to work. The SDK, so called, is more of a "extra crap that we don't ship with visual studio because hardly anybody needs it", which Microsoft abbreviated to SDK. I know. Weird.

  2. You don't need the SDK at all if you intend to use GCC. If you want to write an application for Windows in bare C or bare C++, you can just install mingw if you insist on using gcc and working from the command line.

  3. The normal way to write native applications is to use the free Microsoft Visual C++ Express edition, and you can use it to write either C or C++ apps, and it includes the header files and libraries you need to write almost any native windows application feature you need, without any need for the SDK. Visual Studio is a nice modern IDE, and lots of convenient cool features like code completion and so on. The SDK you downloaded doesn't contain any of that.

  4. Anything you do need to know about the raw Win32 APIs you can learn using the Web format of the MSDN documentation, or the help in Visual Studio. The basic Windows APIs like WinCreateWindow, are documented already in the Visual Studio help and MSDN help, and you don't need the SDK docs for most of the core windows APIs.

If you're just getting started, can I suggest you should just go get the free (but not open source) Visual Studio 2010 Express. That's the recommended way to get started, not the SDK.

I'm quite sure that the Windows 7 SDK that you downloaded is not intended for use with GCC anyways, and if you need a version of windows header files that work with a Gnu C/C++ compiler, any basic Win32 APIs like GDI and the basic Windowing API stuff is already bundled in mingw version of gcc.

You might also want to know about the DDK, which is like the SDK but which is oriented towards Device Driver and native NT-mode development.

Warren P
  • 65,725
  • 40
  • 181
  • 316
  • 2
    The SDK headers are much more complete than the ones included with mingw. – Ben Voigt Feb 19 '12 at 03:35
  • 1
    True, but hardly needed by beginners. And I doubt the SDK headers work with GCC. – Warren P Feb 19 '12 at 03:37
  • I just realized the compiler collection I have has MinGW. That's good. – bgroenks Feb 19 '12 at 04:09
  • The SDK headers work just fine with GCC, and they're absolutely required if you want to do anything more than develop trivial applications. Don't confuse the SDK with downloading Visual Studio. They're completely different things. There are some parts of this answer that are correct and helpful, but other statements are quite misleading, if not borderline incorrect. – Cody Gray - on strike Feb 19 '12 at 08:08
  • @CodyGray What exactly is the Windows SDK for? Isn't naming it Windows SDK kind of misleading? – bgroenks Feb 19 '12 at 20:50
  • Cody's claim seems misleading to me. Name ONE thing you can't do without the SDK installed. I have written very large Windows applications in C++ and have never ever needed any of the SDK headers. Most Windows Apps do not use anything other than the core APIs, and in fact, many Windows apps do not use the APIs directly much at all, and use middle-levels like MFC, ATL, QT, GTK, wxWidgets, and others. – Warren P Feb 19 '12 at 23:39
  • 1
    I'm also pretty sure that the header files work either using pragmas or stub library files, that will prevent DLL imports from "just working" when the headers were designed for Visual C++ and are being used for GCC. – Warren P Feb 19 '12 at 23:43
  • @Warren: Your argument, then, is that MinGW is bundled with the SDK. That's fine. Some people might want to use a newer version of the SDK to utilize features included with new versions of Windows. You can't *not* use the SDK, that's what provides `windows.h` and all the other associated header files. Don't confuse the SDK with Microsoft's other development tools like Visual Studio. And yes, you can obviously use any sort of *wrapper* around the SDK, but that's not what this question is about. – Cody Gray - on strike Feb 20 '12 at 01:39
  • @ghost: It's for exactly what you think it's for. I have no idea what Warren thinks it's for. – Cody Gray - on strike Feb 20 '12 at 01:40
  • I'm still waiting to hear what "useful thing" the SDK lets Cody Gray do. I haven't found anything useful it does yet. – Warren P Feb 21 '12 at 17:48
  • It lets you write Windows applications. You absolutely cannot do this without the SDK. It's irrelevant how you obtain the SDK, whether you download the full version from Microsoft or obtain a version with MinGW. This isn't that hard to research for yourself. Definitely required before posting answers making claims. – Cody Gray - on strike Feb 25 '12 at 09:43
  • Thanks for not answering my question there Cody. SDK as defined by you, means any copy of windows.h, with or without anything else? (Facepalm. I give up trying to talk sense to this person.) – Warren P Mar 26 '12 at 19:03