Advertisement

surprise....a windows error

Started by February 05, 2002 05:55 PM
5 comments, last by samosa 22 years, 7 months ago
hey, im fairly new to directX and windows programming, but i have bought a book and started putting in an effort(yes yes i know, very interesting) anyway, as i am no expert, i have gotten 20 errors on my first compile i have managed to fix all of them except for one, and i dont understand it, if you can, please help, im sure you would like to know what the problem is, well, here is the error message and the line of code that it is specifying.... error C2065: ''WindowProc'' : undeclared identifier error C2440: ''='' : cannot convert from ''int'' to ''long(__stdcall*)(struct HWND__ *,unsigned int,unsigned int,long)'' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast and the line of code.... wc.lpfnWndProc=WindowProc; //window message handler ,Matt -= kill one your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
It means you''ve not implemented the WindowFunc function, or the compiler doesn''t know where it is when it compiles that section of code.
Advertisement
thanks a lot, but now i get another error (yes im a stupid newbie, im sorry) it says this...

LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16

any idea of what it could be?


,Matt

-= kill one your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
Does your program have a main function or a WinMain? From the given error it seems that you want a Windows Application project, which should have a WinMain function. Look up WinMain in MSDN (available online).

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
i have the winmain function in my program, to be honest i was retyping to code from another VC++ project from a disk from the book i got on directX, and as i copied it i read the book so that i understand everything the author is saying, my program is identical to his(only the code isnt as messy) and his works fine, i have all the same lib files and inculdes as him, i dont know what to do.

,Matt

-= kill one your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
OH MY GOD!!!!!! the resolution to that error was instead of having Winmain(etc...) i was supposed to have WinMain(etc...), thats unbelievable, its midnight ive been working on this all day!!!! well now i know, i never thought C++ was case sensitive to this extent, but i am growing out of my newbie attrie and soon growing into a "rookie", happy coding guys, thanks for the help Oluseyi and siaspete, c ya

,Matt

-= kill one your a murderer, kill thousands your a conquerer =-
-= kill one you're a murderer, kill thousands you're a conquerer =-
Advertisement
quote: Original post by samosa
i never thought C++ was case sensitive to this extent


THere is case sensitive, and then there is not case-sensitive. I dont know of any in-betweens...But yeah, be careful what you type!

-----------------------------
The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement