Jump to content
  • Advertisement
Sign in to follow this  
thugkilla

Another Windows problem

This topic is 4795 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here is my source code #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE PrevInstance, LPSTR lpCmdLine,int nCmdShow) { MSG msg; MyRegisterClass(hInstance); if (!InitInstance (hInstance,nCmdShow)); return FALSE; while(GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } Here is my error log Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\Makefile.win" Executing make clean rm -f Untitled1.o Project1.exe g++.exe -c Untitled1.cpp -o Untitled1.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" Untitled1.cpp: In function `int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)': Untitled1.cpp:6: error: `MyRegisterClass' undeclared (first use this function) Untitled1.cpp:6: error: (Each undeclared identifier is reported only once for each function it appears in.) Untitled1.cpp:7: error: `InitInstance' undeclared (first use this function) make.exe: *** [Untitled1.o] Error 1 Execution terminated Whats wrong with it?

Share this post


Link to post
Share on other sites
Advertisement
"Untitled1.cpp:6: error: `MyRegisterClass' undeclared (first use this function)"
Tell me. What do YOU think this error means? What does "undeclared" mean?

Share this post


Link to post
Share on other sites
Quote:
Original post by Gunslinger RR
According to MSDN, the functions are:

myregisterclass
initinstance


Source.


No, those are keywords, not function names. They are all lowercase because keyword lookups on MSDN are not case sensitive, so it doesn't matter.

Sneftel's response should have him on the right track.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dave Hunt
Quote:
Original post by Gunslinger RR
According to MSDN, the functions are:

myregisterclass
initinstance


Source.


No, those are keywords, not function names. They are all lowercase because keyword lookups on MSDN are not case sensitive, so it doesn't matter.

Sneftel's response should have him on the right track.


Bleh that's what I get for trying to be helpful [grin]

In that case ignore my post and look at Sneftel's.

Share this post


Link to post
Share on other sites
"undeclared" says nothing about capital letters. Look it up in the dictionary if you have to. Better yet, look it up in your book on C++. What does it mean to "declare" a function? Have you "declared" what your compiler has told you is "undeclared"?

Error messages aren't hieroglyphics. Modern compilers go far, far out of their way to give you error messages which are concise and helpful. They're written in English. Read them.

Share this post


Link to post
Share on other sites
are you saying I need to declare it like void registermyclass(HINSTANCE)
and then
{
....what it does...
}
I'am so confusing why can't you just tell me?

Share this post


Link to post
Share on other sites
Quote:
Original post by thugkilla
are you saying I need to declare it like void registermyclass(HINSTANCE)
and then
{
....what it does...
}

Pretty much. However, keep in mind that case sensitivity DOES matter.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!