include error (windows.h)

This is a discussion on include error (windows.h) within the Game Programming forums, part of the General Programming Boards category; 1>------ Build started: Project: opengl, Configuration: Debug Win32 ------ 1>Compiling... 1>helloworld.cpp 1>d:\documenten en settings\graphic\mijn documenten\c++\opengl\helloworld.cpp(1) : fatal error C1083: Cannot ...

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    1

    Question include error (windows.h)

    1>------ Build started: Project: opengl, Configuration: Debug Win32 ------
    1>Compiling...
    1>helloworld.cpp
    1>d:\documenten en settings\graphic\mijn documenten\c++\opengl\helloworld.cpp(1) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
    1>Build log was saved at "file://d:\Documenten en settings\graphic\Mijn documenten\C++\OpenGL\Debug\BuildLog.htm"
    1>opengl - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


    code :
    #include <windows.h>
    int APIENTRY WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow)
    {

    MessageBox(NULL, "\tHello World!", "My first windows app", NULL);
    return 0;
    }

    anyone helpful ?
    compiling with bcc32 (borland) and tried with MSVisual C++ 2005 Express

    DamN (nickname)

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,548
    Visual express is JUST the compiler and associated programs.

    You also need the platform SDK
    http://msdn.microsoft.com/vstudio/ex...alc/usingpsdk/
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    with borland

    bcc32 -tW helloworld.cpp
    try that

    edit

    and make sure your bcc32.cfg file is configured

    Code:
     -I"c:\Borland\Bcc55\Include"
    
          -L"c:\Borland\Bcc55\Lib"
    edit
    also check the faq on this bb
    Last edited by kryptkat; 07-30-2006 at 09:07 AM.

  4. #4
    C / C++
    Join Date
    Jan 2006
    Location
    The Netherlands
    Posts
    312
    First: you shouldn't use Borland. It's not very actual. I tried to compile my first Windows-API program there too, but I didn't succeed Dev-C++ is a good replacement, but MSVisual C++ 2005 Express should work.
    Operating Systems:
    - Ubuntu 9.04
    - XP

    Compiler: gcc

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    you shouldn't use Borland [...] I tried to compile my first Windows-API program there too, but I didn't succeed
    Did you try what kryptkat suggested?

    Dev-C++ is good, though: http://www.bloodshed.net/devcpp.html
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  6. #6
    C / C++
    Join Date
    Jan 2006
    Location
    The Netherlands
    Posts
    312
    I can't use Borland anymore :P I use Linux most of the time, Windows is still on my pc, but it doesn't want to start anymore :P But it doesn't matter, I have the files and I can install them on another pc.
    Operating Systems:
    - Ubuntu 9.04
    - XP

    Compiler: gcc

  7. #7
    User
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    498
    You should note though, that Dev-C++ is not an actual compiler. It's an integrated development enviroment, just like Code::Blocks, and KDevelop. With Dev-C++ and Code::Blocks, you can choose between gcc (Gnu C Compiler), or MinGW.

    On the other hand, Visual C++ is both an integrated development envirment, AND a compiler. And you can't change the compiler that Visual C++ uses (at least not easily).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. debug assertion failed!
    By chintugavali in forum C Programming
    Replies: 4
    Last Post: 12-11-2007, 05:23 AM
  2. MFC include BS
    By VirtualAce in forum Windows Programming
    Replies: 4
    Last Post: 10-31-2005, 11:44 AM
  3. help with finding lowest number entered
    By volk in forum C++ Programming
    Replies: 12
    Last Post: 03-22-2003, 12:21 PM
  4. #includes don't seem to be working
    By Inquirer in forum C++ Programming
    Replies: 12
    Last Post: 08-05-2002, 05:38 PM
  5. MFC Assertion Failure
    By maxthecat in forum Windows Programming
    Replies: 5
    Last Post: 08-01-2002, 09:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21