Programming and posix - April 2002
April 3, 2002
Solution Symposium
Page 22
hp e3000
programming
and posix
creating an nmrl archive library - 2
• Have our main program in hwcgimain.c call an external:
#include <stdio.h>
extern void helloworld(void);
main()
{
printf("Content-type: text/plain\n\n");
helloworld();
}
shell/iX> gcc -c -D_POSIX_SOURCE hwcgimain.c
• Link the program:
shell/iX> gcc -o hwcgi hwcgimain.o -L. -lhw
• -L. specifies library search directory (. is CWD)
• -lhw refers to libhw.a