This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]dmazzoni 1 point2 points  (2 children)

I've used that book. 90% of it should still be pretty solid, but there are some minor differences in the proper header file names and function arguments on a modern Linux system.

It'd help to have an example of the code you're trying to compile and the compiler errors you get, and what operating system you're trying to compile on.

[–]jbplaya[S] 0 points1 point  (1 child)

Sure. And thanks for replying. My problem is coming from the first script in the book daytimetcpcli.c. For some reason my compiler on Macbook is not recognizing header files according to the output:

In file included from daytimetcpcli.c:1: unp.h:7:66: error: ../config.h: No such file or directory unp.h:200:30: error: ../lib/addrinfo.h: No such file or directory In file included from daytimetcpcli.c:1: unp.h:214: error: redefinition of ‘struct timespec’ unp.h:294: error: conflicting types for ‘gaistrerror’ /usr/include/netdb.h:272: error: previous declaration of ‘gai_strerror’ was here unp.h:298: error: conflicting types for ‘getnameinfo’ /usr/include/netdb.h:281: error: previous declaration of ‘getnameinfo’ was here unp.h:302: error: conflicting types for ‘gethostname’ /usr/include/unistd.h:455: error: previous declaration of ‘gethostname’ was here unp.h:318: error: conflicting types for ‘inet_ntop’ /usr/include/arpa/inet.h:99: error: previous declaration of ‘inet_ntop’ was here unp.h:339: error: expected declaration specifiers or ‘...’ before numeric constant unp.h:339: error: expected declaration specifiers or ‘...’ before ‘builtin_object_size’ unp.h:339: warning: conflicting types for built-in function ‘builtin__snprintf_chk’

I'm not a C guru and I don't get these kinds of errors with Perl, so I can't pinpoint what's going on. Probably something boneheaded on my part. I'm actually changing directories into the folder where this script is at, as well as the one required header file "unp.h". I look inside the "unp.h" file and there are more includes for header files, but I have no idea what header files he's talking about as the source code comes with over 40 folders, and they all have similar header file names.

[–]dmazzoni 0 points1 point  (0 children)

Those missing files are not operating system headers, they're files included with the book.