Jump to content
  • Advertisement
Sign in to follow this  
dshipp82

[.net] Problems with compiling this line of code

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

I'm trying to compile some code out of Programming Role Playing Games with DirectX 2nd Edition by Jim Adams, i've gotten everything else so far working fine for it except this line. virtual FAR PASCAL MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { return DefWindowProc(hWnd, uMsg, wParam, lParam); } Keep getting the standard error: f:\projects\tower\the tower\gamecore\core_system.h(44) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int I've tried fiddling around with this section of code a fair bit without success. Any help would be gratelly appreciated. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Window procedures have a return type of LRESULT, so you'll want this:

virtual LRESULT FAR PASCAL MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { return DefWindowProc(hWnd, uMsg, wParam, lParam); }

Share this post


Link to post
Share on other sites
THank you very much too everyone that helped. Got it fully working. The only part i'm not happy with now before i've finished getting all this code to compile and doing major overhauls and modifications to it, is

the network core is playing up. I'm getting the following errors:

Core_Network.obj : error LNK2019: unresolved external symbol _inet_ntoa@4 referenced in function "public: int __thiscall cNetworkServer::GetIP(char *,unsigned long)" (?GetIP@cNetworkServer@@QAEHPADK@Z)
Core_Network.obj : error LNK2019: unresolved external symbol _WSACleanup@0 referenced in function "public: int __thiscall cNetworkServer::GetIP(char *,unsigned long)" (?GetIP@cNetworkServer@@QAEHPADK@Z)
Core_Network.obj : error LNK2019: unresolved external symbol _gethostbyname@4 referenced in function "public: int __thiscall cNetworkServer::GetIP(char *,unsigned long)" (?GetIP@cNetworkServer@@QAEHPADK@Z)
Core_Network.obj : error LNK2019: unresolved external symbol _gethostname@8 referenced in function "public: int __thiscall cNetworkServer::GetIP(char *,unsigned long)" (?GetIP@cNetworkServer@@QAEHPADK@Z)
Core_Network.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function "public: int __thiscall cNetworkServer::GetIP(char *,unsigned long)" (?GetIP@cNetworkServer@@QAEHPADK@Z)
.\Debug/Game.exe : fatal error LNK1120: 5 unresolved externals

All other cores are compiling correctly, this core is not necessary for the game i'm writing at the moment, but i'd like to support multi-playability by the end of the development. Anyone got any idea's on this, I THINK i've linked all the libraries necessary through the Project Options dialogue. I'm using VBNet 2005. Though I have nothing linked in the resources folder, only .h's in headers and .cpp's in source.

Thanks for any help.
Daniel

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.

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

Sign me up!