Thread: error C2065: 'inet_pton' : undeclared identifier - ipv6

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    1

    Thumbs up error C2065: 'inet_pton' : undeclared identifier - ipv6

    Hi.
    I am using Visual C++ 6.0, Windows xp and Jrtplib(Rtp library).
    I have a code for ipv6 and It compile right in Linux, but It doesn't compile in windows.

    the error is:
    f:\jrtplib_examples\example1_ipv6\ejemplo1_ipv6.cp p(63) : error C2065: 'inet_pton' : undeclared identifier
    f:\jrtplib_examples\example1_ipv6\ejemplo1_ipv6.cp p(67) : error C2065: 'inet_ntop' : undeclared identifier
    f:\jrtplib_examples\example1_ipv6\ejemplo1_ipv6.cp p(75) : error C2065: 'RTPUDPv6TransmissionParams' : undeclared identifier
    f:\jrtplib_examples\example1_ipv6\ejemplo1_ipv6.cp p(75) : error C2146: syntax error : missing ';' before identifier 'transparamsv6'
    f:\jrtplib_examples\example1_ipv6\ejemplo1_ipv6.cp p(75) : error C2065: 'transparamsv6' : undeclared identifier
    f:\jrtplib_examples\example1_ipv6\ejemplo1_ipv6.cp p(79) : error C2228: left of '.SetPortbase' must have class/struct/union type
    f:\jrtplib_examples\example1_ipv6\ejemplo1_ipv6.cp p(84) : error C2065: 'RTPIPv6Address' : undeclared identifier
    f:\jrtplib_examples\example1_ipv6\ejemplo1_ipv6.cp p(84) : error C2146: syntax error : missing ';' before identifier 'addr_v6'
    f:\jrtplib_examples\example1_ipv6\ejemplo1_ipv6.cp p(84) : error C2065: 'addr_v6' : undeclared identifier
    Error executing cl.exe.
    Creating browse info file...

    Example1_ipv6.exe - 9 error(s), 52 warning(s)
    Somebody can help me?

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    On Windows it is called InetNtop, not inet_ntop, and it is only available on Vista or later. An alternative which is supported on earlier versions of windows is WSAAddressToString, which works all the way back to Win2k.

    For best portability, don't rely on these functions at all. Implement your own version.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    a) you'll need an IPV6 library.
    b) VC6 is OVER 10 years old. Perhaps it's too old to understand about such things.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. Why wont my function exit correctly?
    By LightsOut06 in forum C Programming
    Replies: 2
    Last Post: 10-09-2005, 09:23 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM

Tags for this Thread