[cs631apue] HW2 - get/setprogname

afonsec1 afonsec1 at stevens.edu
Fri Sep 23 00:46:08 EDT 2011


On Thu, 22 Sep 2011 22:09:44 -0400, Rob Hoffmann wrote:
> Hello,
>
> I'm having some trouble using getprogname and setprogname as per the
> style guide. When I google for the man page I see that they are in 
> the
> stdlib.h library, so I have included it in my program. However, when 
> I
> compile my program, I get these errors:
>
> /tmp/ccAjJ13K.o: In function `main':
> tcp.c:(.text+0x1f): undefined reference to `setprogname'
> /tmp/ccAjJ13K.o: In function `usage':
> tcp.c:(.text+0x7b): undefined reference to `getprogname'
>
> Interestingly, typing "man setprogname" or "man getprogname" does not
> bring up any man page on the Linux lab machines. Do these functions
> even exist in stdlib.h in that environment?
>
> -Rob
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/cgi-bin/mailman/listinfo/cs631apue

Did you link the libc library to it?

For some reason, you have to omit the word lib, so to include it will 
be: -lc

Armando



More information about the cs631apue mailing list