Entry Point Not Found?!

This is a discussion on Entry Point Not Found?! within the C++ Programming forums, part of the General Programming Boards category; Hi, so I'm getting a pop up error message with a title of "Entry Point Not Found" and a message ...

  1. #1
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230

    Entry Point Not Found?!

    Hi, so I'm getting a pop up error message with a title of "Entry Point Not Found" and a message of "The procedure entry point InetNtopW could not be located in the dynamic link library WS2_32.dll". This happens when I run this program, the second I launch it the message pops up, it doesn't even print the first line. Without the inet_ntop function call it will compile/work correctly though. I also tried replacing inet_ntop with a call to inetNtop, and it just does the exact same error pop up. I'm using Unicode character set of that's important (which is default as far as I know).

    I took a screenshot for you: http://img79.imageshack.us/my.php?im...goingonzc2.jpg

    Here is the code:

    Code:
    #include <iostream>
    #include <winsock2.h>
    #include <ws2tcpip.h>
    #include <cstring>
    
    using std::cout;
    using std::cin;
    using std::endl;
    
    WSADATA wsaData;
    
    int main(int argc, char * argv[]) {
    	int wsaReturnVal = WSAStartup(MAKEWORD(1, 1), &wsaData);
    	if (wsaReturnVal) {
    		cout << "Error number: " << wsaReturnVal << endl;
    		exit(1);
    	}
    	char * fpoint = strrchr(argv[0], '\\');
    	if (argc != 2) {
    		printf("Usage: <&#37;s> <hostname>", fpoint+1);
    		exit(1);
    	}
    	struct addrinfo hints, *res, *p = NULL;
    	memset(&hints, 0, sizeof(hints));
    	hints.ai_flags = AI_PASSIVE;
    	hints.ai_family = AF_UNSPEC;
    	hints.ai_socktype = SOCK_STREAM;
    
    	int status = getaddrinfo(argv[1], NULL, &hints, &res);
    	if (status == -1) {
    		cout << "getaddrinfo error." << endl;
    		exit(1);
    	}
    	
    	printf("IP address for %s: ", argv[1]);
    	for (p = res; p != 0; p = p->ai_next) {
    		void * addr;
    		char * ipVer;
    		if (p->ai_family == AF_INET) {
    			struct sockaddr_in * IPv4 = (struct sockaddr_in *)p->ai_addr;
    			addr = &(IPv4->sin_addr);
    			ipVer = "IPv4";
    		}
    		else {
    			struct sockaddr_in6 * IPv6 = (struct sockaddr_in6 *)p->ai_addr;
    			addr = &(IPv6->sin6_addr);
    			ipVer = "IPv6";
    		}
    		char ipBuff[46];
    		inet_ntop(hints.ai_family, addr, ipBuff, sizeof(ipBuff));
    		printf("%s: %s", ipVer, ipBuff);
    	}
    
    
    	freeaddrinfo(res);
    
    	if (WSACleanup()) {
    		cout << "Cleanup Error." << endl;
    		exit(1);
    	}
    }
    Cheers.
    Last edited by pobri19; 10-25-2008 at 08:52 AM.
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,660

  3. #3
    Registered User
    Join Date
    May 2008
    Location
    Australia
    Posts
    230
    So... both inet_ntop and InetNtop are Vista or Server 2008?! Geeze... That's lame. Ahwell, cheers bud.
    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. For the numerical recipes in C types!
    By Smattacus in forum C Programming
    Replies: 5
    Last Post: 10-28-2008, 07:57 PM
  2. Drawing Program
    By Max_Payne in forum C++ Programming
    Replies: 21
    Last Post: 12-21-2007, 04:34 PM
  3. Program Entry Point
    By Sentral in forum C++ Programming
    Replies: 16
    Last Post: 07-28-2006, 03:36 AM
  4. How accurate is the following...
    By emeyer in forum C Programming
    Replies: 22
    Last Post: 12-07-2005, 11:07 AM
  5. Going out of scope
    By nickname_changed in forum C++ Programming
    Replies: 9
    Last Post: 10-12-2003, 06:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21