Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
Does anyone know what I need to install to have windows.h under the linux system? I'm looking for basic windows files to be included into the /usr/include directory....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    windows.h


    Does anyone know what I need to install to have windows.h under the linux system? I'm looking for basic windows files to be included into the /usr/include directory.
    The best things in life are free.

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    windows.h is for compiling Windows programs, you do know that, right? gcc doesn't have support for PE files (there are surely extensions to add that, but not in the standard gcc distributions). If anything, I guess that you can install the Wine compatibility libraries, so that you can compile Windows programs for X instead.

  3. #3
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    wine libs

    Dolda,

    Can I download and install the wine libaries and then link them later? I would assume that the libraries for wine aren't going to be dumped into /usr/include. What I was thinking was to create a windows.h as a softlink to point to wherever the real windows.h lies. Unless of course I can do something like this in the C preprocessor directive #define
    Code:
    // let's say the windows library lies /usr/wine/libs/windows.h
    // I don't think this next line would work since I am under the impression
    // that directive include starts at /usr/include
    #include </usr/wine/libs/windows.h>
    
    // I do this hope that this works pending that this file is a softlink as I
    // mentioned earlier
    #include <windows.h>
    
    // I like to use -Wall and lint so the return type must be an int
    int main&#40;&#41;
    &#123;
      ....
    
      return 0;
    &#125;
    The best things in life are free.

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    What exactly is it that you wish to accomplish? Whether or not you have the libraries, you'll still need the headers to be able to compile the object files. And since the headers come with the library distribution, why not just install it all at the same time?

  5. #5
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319

    openGL

    Dolda,

    I'm going to take on openGL programming very soon and I'm just experiementing with sample files. Most if not all these files need the windows.h file as well as other windows file I would assume. What library can I install under the linux platform?
    The best things in life are free.

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    OpenGL doesn't require Windows headers or libraries; it's designed to be a platform independent wrapper layer on top of the windowing system, be it Windows or X11. As far as I remember, there is GL, which is the core library, GLU, which provides modelling and texturing utils and GLUT, which provides utils for creating windows and entering full-screen modes in a platform independent way, isn't that correct.
    I've really just read a little about OpenGL when I was going to begin programming with it months ago, but I gave it up for more important projects.
    Try checking out the source code for tuxracer or chromium, and you'll find ways of doing this without windows.h. (Chromium supports Windows as well, so you will find windows.h there, but it won't be used when compiled for Linux.)

  7. #7
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Dolda,

    I know that windows.h isn't required but the source code that we are using requires it. I also believe this is left in there because we'll be doing projects both on unix and windows.

    bp
    The best things in life are free.

  8. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Oh, then I get it.
    In that case, wouldn't the best solution be to just make it possible to compile correctly, ie.
    Code:
    #ifndef __linux__
    #include <windows.h>
    #endif
    If you didn't know, __linux__ is a cpp definition automatically defined when cpp is running on a linux system. Even better would of course be to use #ifdef __windows__, but I don't know if there is such a thing.
    It seems a bit unneccessary to include headers and link libraries that won't be needed when running in Linux; they'll only increase compile time and memory usage of the program.

  9. #9
    Just Joined!
    Join Date
    Feb 2003
    Location
    Wah Cantt, Pakistan.
    Posts
    8
    is there any library ..(other than those Open GL because they seems complex for a beginner)... like graphics.h that is used for graphics programming in dos,

  10. #10
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Actually, graphics.h isn't a DOS thing, it's just a Microsoft thing. The C standard does not specifiy it, it graphics is platform dependent, and not available on all architectures.
    I'm not sure what to recommend, though. Maybe svgalib?

Page 1 of 2 1 2 LastLast

Posting Permissions

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