Sign in to follow this  
dshipp82

[.net] Problems with compiling this line of code

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this