-
December 22nd, 2007, 10:37 AM
#1
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.
-
December 22nd, 2007, 12:57 PM
#2
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.
-
December 22nd, 2007, 06:23 PM
#3
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?
-
December 22nd, 2007, 06:45 PM
#4
Re: Compiler Problems [VC++ 2005]
-
December 23rd, 2007, 10:10 AM
#5
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.
-
December 23rd, 2007, 08:28 PM
#6
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.
-
December 24th, 2007, 12:04 AM
#7
Re: Compiler Problems [VC++ 2005]
OK, you know it helps us if you show exact errors.
-
December 24th, 2007, 08:41 AM
#8
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
-
December 24th, 2007, 11:34 AM
#9
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
-
December 24th, 2007, 12:08 PM
#10
Re: Compiler Problems [VC++ 2005]
-
December 24th, 2007, 01:57 PM
#11
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|