Sign in to follow this  

Platform SDK IOCP Example

This topic is 4108 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 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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4108 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.

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