Orchid Orchid - 7 months ago 53
Objective-C Question

Implicit declaration of function 'ether_ntoa' is invalid in C99

It's part of a series of functions that retrieve IP & Mac addresses from the phone.

strcpy(temp, (char *)ether_ntoa((const struct ether_addr *)LLADDR(sdl)));

EDIT: No equivalent function needed, there were just a few missing headers.

EDIT: Added cast to LLADDR(sdl)


As I read it, the error message isn't claiming that the function is missing, only that you don't include its declaration. (I don't know that it exists, only that the message has a different complaint.)

In case it helps, man ether_ntoa tells me:

#include <sys/types.h>
#include <sys/socket.h>
#include <net/ethernet.h>