Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

LoserPrime

Help with lesson 1 please

This topic is 6014 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

hello, Im getting the following errors on compile, using Dev-C++ 4.01. CDS_FULLSCREEN undeclared(first use this function) implicit declaration function int CreateWindowEX(...) assignment to HWND__ from int lacks a cast parse error at end of input Okay with this CDS Fullscreen thing from what i understand this should be supplied by the header file for windows? with the creatwindowex thing i dont even have a clue its like its saying it needs to be used before declaration or something and the HWND im not casting anything so why should i need to cast the parse error i thought was from a missing bracket to close a function but i guess not now because i added it but still have the problem... How many assholes we got on this ship?!....YO!

Share this post


Link to post
Share on other sites
Advertisement
  
#ifndef CDS_FULLSCREEN

#define CDS_FULLSCREEN 4

#endif


Add that before #include and all will be well. The other errors may have resulted from that. If not, drop another line.

Eh,
ZE.

Share this post


Link to post
Share on other sites
Thanks ZealousElixir,

That did help, and i fixed the parser error myself. However im still having a problem its saying i need to cast something into something else, since i did type this in and checked it more then a few times im sure i put everything in i was suppose to and do not need to cast...but here

  if (!(hWnd=CreateWindowEX(dwExStyle,                        // Extended style for the window

"OpenGL", // Class name

title, // Window title

WS_CLIPSIBLINGS | // Required window style

WS_CLIPCHILDREN | // Required window style

dwStyle, // Selected window style

0, 0, // Window position

WindowRect.right-WindowRect.left, // Calculate adjusted window width

WindowRect.bottom-WindowRect.top, // Calculate adjusted window height

NULL, // No parent window

NULL, // No menu

hInstance, // Instance

NULL))) // Dont pass anything to WM_CREATE


its giving me that implicit delclaration and assignment error....any advice


How many assholes we got on this ship?!....YO!

Share this post


Link to post
Share on other sites
"implicit declaration function int CreateWindowEX(...)" basically means that CreateWindowEX isnt defined (CreateWindowEx() maybe? I forget).

Because the compiler dosnt know what CreateWindowEX is, it defaults it to extern int CreateWindowEx(something). This should be why youre getting "assignment to HWND__ from int lacks a cast." The compiler thinks CreateWindowEx is returning an int, and warns you about typecasting.

Your code looks perfect, shouldnt be a problem.

Dev-C++ 4.01 sounds pretty old (although I have no idea, excuse me if I''m wrong). Maybe the header files supplied with it dint contain CreateWindowEX. If this is the case try with CreateWindowe()

Share this post


Link to post
Share on other sites
hi,
i tried that did not help though. Thanks for trying if anyone can tell me what are the special considerations for Dev-C++

I know there are some and i thought i had done them all...



How many assholes we got on this ship?!....YO!

Share this post


Link to post
Share on other sites
maybe you didnt include all the necessary libraries.....
just thought adding the neccessary libraries would be more appropriate than defining...

..I still dont get the difference between c and c++...

Share this post


Link to post
Share on other sites
quote:
Original post by glGreenhorn
suggestion: VC4.01 IS old. why don''t you download BC++6.0 freeware compiler from Borland''s site? that would solve your problem.

keep cool



I''ll keep cool, but maybe you need eye surgery? He said Dev-C++, not M$VC.

quote:

if (!(hWnd=CreateWindowEX(dwExStyle,



It''s exactly like alargeduck said, dude. C++ is case-sensitive, and the function is named CreateWindowEx(). He correctly mentioned that the error was caused by an implicit delcaration of CreateWindowEX that had no definition.

BTW, 4.01 s the newest version of Dev-C++, as far as I know; it''s what I use.

Later,
ZE.

Share this post


Link to post
Share on other sites
hello everyone,

Thanks for the help so far, heres what i was thinking.
Could someone who uses dev C++ tell me what they do to get it working for them. all the libraries and includes and whatever else they need for it to work. That would most likely clear things up..


How many assholes we got on this ship?!....YO!

Share this post


Link to post
Share on other sites
quote:
Original post by azaxaca
maybe you didnt include all the necessary libraries.....
just thought adding the neccessary libraries would be more appropriate than defining...

..I still dont get the difference between c and c++...


Is that last line your sig? Either way, you aren''t exactly qualified to say what you just did. Some implementations of the library that contains ChangeDisplaySettings simply do not have a definition for CDS_FULLSCREEN. There is no better way than defining it, and there''s nothing wrong with that.

Later,
ZE.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!