CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2007
    Posts
    76

    Compiler Problems [VC++ 2005]

    What is this? I'm using a Microsoft IDE, and it cant include windows.h, I was thinking that it may be because the project and files are on the network, but that doesn't make sense because the freeware IDE I was using worked fine at the same place with the same code. Here's a look at the error:
    Code:
    .\main.cpp(1) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
    Last edited by HKothari; December 22nd, 2007 at 10:41 AM.

  2. #2
    Join Date
    May 2007
    Posts
    811

    Re: Compiler Problems [VC++ 2005]

    It is helpful if you specify exact version of your compiler. There are several with 2005 designation. I will venture a guess here that you are using VC++ 2005 Express edition (free), which does not come in with Windows SDK. That you have to download it yourself seperatly. Seach MSDN for it and you will find it.

  3. #3
    Join Date
    Dec 2007
    Posts
    76

    Re: Compiler Problems [VC++ 2005]

    Thank you, yes, I am using express, but I can not find the window sdk for xp. Any suggestions as to the location?

  4. #4
    Join Date
    Aug 2001
    Location
    Stockholm, Sweden
    Posts
    1,664

    Re: Compiler Problems [VC++ 2005]


  5. #5
    Join Date
    Dec 2007
    Posts
    76

    Re: Compiler Problems [VC++ 2005]

    Oh, thank you, I saw this one, and I thought it was only for windows server 2003, but apparently it's for xp too. Thank you.

  6. #6
    Join Date
    Dec 2007
    Posts
    76

    Re: Compiler Problems [VC++ 2005]

    Sorry to drag this out, but for some reason, now it compiles, but there is are now a bunch of linking errors, and I'm confused why this is happening because I set the library path to the correct location.

  7. #7
    Join Date
    May 2007
    Posts
    811

    Re: Compiler Problems [VC++ 2005]

    OK, you know it helps us if you show exact errors.

  8. #8
    Join Date
    Dec 2007
    Posts
    76

    Re: Compiler Problems [VC++ 2005]

    Code:
    main.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
    main.obj : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
    main.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
    main.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
    main.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
    main.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16
    main.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16
    main.obj : error LNK2019: unresolved external symbol __imp__GetMessageA@16 referenced in function _WinMain@16
    main.obj : error LNK2019: unresolved external symbol __imp__UpdateWindow@4 referenced in function _WinMain@16
    main.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function _WinMain@16
    main.obj : error LNK2019: unresolved external symbol __imp__RegisterClassExA@4 referenced in function _WinMain@16
    main.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function _WinMain@16
    main.obj : error LNK2019: unresolved external symbol __imp__LoadIconA@8 referenced in function _WinMain@16
    Thanks

  9. #9
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Compiler Problems [VC++ 2005]

    Those are all Win32 functions, and their definitions are in the import libraries. Did you specify the libraries in the Link section?

    The libraries are kernel32.lib, user32.lib, gdi32.lib, etc.

    Regards,

    Paul McKenzie

  10. #10
    Join Date
    Dec 2007
    Posts
    76

    Re: Compiler Problems [VC++ 2005]

    Link Section?

  11. #11
    Join Date
    May 2007
    Posts
    811

    Re: Compiler Problems [VC++ 2005]

    Reading docs for VC++ helps. Since it's Christmas time here, here is MSDN help on linker options. If you look around there you will find plenty of help.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured