Results 1 to 4 of 4

Thread: windows.h

  1. #1
    Join Date
    Dec 2006
    Ubuntu 7.04 Feisty Fawn


    How would I get a windows.h file so i can do c++ programs that use it
    if you write in binary long enough you’re liable to lose your penmanship

    = (

  2. #2
    Join Date
    Oct 2006
    Ubuntu 7.04 Feisty Fawn

    Re: windows.h

    windows.h is a windows specific header file and is not for linux.. i'm sure if its possible to use in linux..
    Registered Linux user # 0x6D9B1

  3. #3
    Join Date
    Feb 2007

    Re: windows.h

    All windows C/C++ code references Windows.h, but you don't need that for Linux. Simply comment out that #include statement. If the code then compiles with lots of error messages, then the code may be using some Windows specific APIs. In that case, you'll need to rewrite the Windows-specific code.

    NOTE: Besides defining some Windows-specific APIs, Windows.h also contains lots of typedefs to define standard C datatypes to various "generic Windows datatypes". For example DWORD is typedef to be a standard C unsigned long. If those error messages concern only such datatypes, then you could perhaps coerce the code into compiling by including those typedefs in the code, for example:

    #ifndef DWORD
    #define WINAPI
    typedef unsigned long DWORD;
    typedef short WCHAR;
    typedef void * HANDLE;
    #define MAX_PATH PATH_MAX
    typedef unsigned char BYTE;
    typedef unsigned short WORD;
    typedef unsigned int BOOL;

    But if you really, really, really need Windows.h, then go to Microsoft's web site and download the "Platform SDK" (Platform Software Development Kit). You'll have to install it upon some Windows system, and somewhere in your program files directory, you'll find a Microsoft folder containing a bunch of subfolders filled with .H, .LIB, and other files. Among them, you'll find Windows.h (which itself includes a whole bunch of those other .H files).
    Last edited by j_g; August 24th, 2007 at 08:12 AM.

  4. #4
    Join Date
    Dec 2009

    Re: windows.h

    Sorry to reopen this, but windows.h is included in the Wine Development packages. This will let you compile something thats looking for windows.h


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts