Thread: Problems reading windows.h

  1. #1
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204

    Thumbs up Problems reading windows.h

    So it seems my my windows.h is dead in VS2008 C++. Before, it worked fine and nothing was wrong with it. But just yesterday, it started saying that everything windows related is not declared, found, identified, etc...
    Just to clear things up, I am including windows.h and windows.h is in the correct directory yet I haven't touched anything. It can't be the code because I am litterally recompiling code that worked just the other day. When I right-click on the #include <windows.h> and go to "Go to header file", it doesn't do anything. When I right-click on a windows variable and go to "Go to definition/declaration", it says there is none.
    I also tried reinstalling VS2008, but no luck.

    I don't know what else to say. Any help is much appreciated.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Are you using precompiled headers?
    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.

  3. #3
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    I go to "Rebuild Solution", so I assume that it rebuilds everything from the beginning.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Quit visual studio

    Make a backup of the entire directory (source code, project files, build directories).

    Then delete
    - debug and release directories
    - anything in the top level directory which you didn't specifically create, and which isn't .dsp/.dsw/.sln

    You should just have your source code and the initial project files.
    Everything else can/should be recreated when you next start visual studio, or do a build.
    If it complains about missing files, then that's what your backup is for

    Or you could try first
    - build (clean)
    - build (rebuild all)
    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.

  5. #5
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    I tried all of that, Salem, but to no avail. What do you think would happen if I deleted my entire include directory in the VS2008 folder and then reinstalled VS? Do you think it would replace all the missing files and maybe fix the problem... or would I just be digging my own grave?

    Thanks for the help, though!

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Are you including any other file BEFORE windows.h? If so, have you perhaps made a mistake with a brace or something like that in that header file?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    No, just the standard stdafx.h. Some of the source code I am trying used before and worked fine. I even got code from Forger's but I get the same thing. I pretty sure it's VS-related.

  8. #8
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    Well, I fixed the problem. For future reference: I deleted (and backed up) the "Microsoft SDKs/Windows/" folder and then reinstalled VS2008. It seems to have done the trick.
    Thanks everyone for your help!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems in reading binary file
    By serena in forum C Programming
    Replies: 3
    Last Post: 04-14-2005, 03:54 AM
  2. More Reading in problems
    By swayp in forum C++ Programming
    Replies: 6
    Last Post: 01-28-2005, 04:27 PM
  3. Huge problems in Winsock recv!
    By sirSolarius in forum Networking/Device Communication
    Replies: 0
    Last Post: 09-11-2004, 09:34 AM
  4. Reading from file problems
    By highlands in forum C++ Programming
    Replies: 3
    Last Post: 03-22-2004, 12:50 PM
  5. Reading in the last few characters of a file problems
    By dfb78 in forum C++ Programming
    Replies: 3
    Last Post: 05-05-2002, 06:56 PM