Skip to main content
gamedev.net
🔒 Locked

Platform SDK IOCP Example

Started by Crazyfool Sep 13, 2006 at 9:56 PM 2 replies 2.3k views
Original Post
Crazyfool
Crazyfool
I do everything I see that it says for me to do, and hit compile: Im talking about the IOCP sample server code from the platform SDK, it happens with serverex or server. Compiling... Main.cpp C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(366) : error C2079: 'hints' uses undefined struct 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(373) : error C2228: left of '.ai_flags' must have class/struct/union type C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(373) : error C2065: 'AI_PASSIVE' : undeclared identifier C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(374) : error C2228: left of '.ai_family' must have class/struct/union type C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(375) : error C2228: left of '.ai_socktype' must have class/struct/union type C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(376) : error C2228: left of '.ai_protocol' must have class/struct/union type C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(378) : error C2065: 'getaddrinfo' : undeclared identifier C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(388) : error C2027: use of undefined type 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(366) : see declaration of 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(388) : error C2227: left of '->ai_family' must point to class/struct/union C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(388) : error C2027: use of undefined type 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(366) : see declaration of 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(388) : error C2227: left of '->ai_socktype' must point to class/struct/union C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(388) : error C2027: use of undefined type 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(366) : see declaration of 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(388) : error C2227: left of '->ai_protocol' must point to class/struct/union C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(395) : error C2027: use of undefined type 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(366) : see declaration of 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(395) : error C2227: left of '->ai_addr' must point to class/struct/union C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(395) : error C2027: use of undefined type 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(366) : see declaration of 'addrinfo' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(395) : error C2227: left of '->ai_addrlen' must point to class/struct/union C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(461) : error C2065: 'freeaddrinfo' : undeclared identifier C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(490) : error C2065: 'PDWORD_PTR' : undeclared identifier C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(490) : error C2297: '&' : illegal, right operand has type 'struct _PER_SOCKET_CONTEXT *' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(617) : error C2065: 'DWORD_PTR' : undeclared identifier C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(617) : error C2146: syntax error : missing ')' before identifier 'lpPerSocketContext' C:\Program Files\Microsoft Visual Studio\MyProjects\WinSock Example\Main.cpp(617) : error C2059: syntax error : ')' Error executing cl.exe. Any clue why?
yadango
yadango
i just compiled all 3 projects in iocp just fine under visual studio 2005. i don't see a Main.cpp file however, so maybe it's your own code that's messed up? what's in Main.cpp? addrinfo is defined in ws2tcpip.h... looks like you're just forgetting to include a few things.
Crazyfool
Crazyfool
Main is what I named the file, its the same code, main.h is the other code.

Im using VC++ 6.0, but that shouldnt be the problem, wlel I dont think so? It says in the readme for VC users to justr include ws2_32.lib, which I do.
hplus0603
hplus0603
Looks like you're not including before including
enum Bool { True, False, FileNotFound };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.