LINUX.ORG.RU

inet_aton


0

0

hi.

I am having a problem when compiling my source code on RedHat7 (2.4.20-18.7smp, glibc-2.2.5-34)
I get:

undefined reference to `inet_aton(char const *, in_addr *)'

My code includes: #include <arpa/inet.h> and I can compile it on RHEL3.

find . -type f | xargs grep inet_aton /lib/lib*
shows /lib/libc-2.2.5.so seems to include this function...

anonymous

hi.

first of all, you should include a minimal source+Makefile that 
reproduces the problem. Second, there's little chance someone would help
you with such an antiquated distro.

If I put this code into 

--in.c--

#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

int main() {
    struct in_addr a;
    if (inet_aton("192.168.0.1", &a) != 0)
        printf("%ull\n", a.s_addr);
}

and then issue 'make in', I get an executable and no error messages. The program runs OK, too.

Third, you should have configured Cyrillic keyboard layout or used online JS-keyboard, and written in Russian.

anonymous
()
Ответ на: комментарий от anonymous

Thanks a lot. I am sorry for English coz I don't have russian keys :( ok, I will try JS-keyboard...

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.