Programming and posix getting started
16
Creating an Archive Library - 2
• Have our main program:
> cat >hwcgimain.c
#include <stdio.h>
extern void helloworld(void);
main()
{
printf("Content-type: text/plain\n\n");
helloworld();
}
> c89 -c -D_POSIX_SOURCE hwcgimain.c
• Link the program:
> c89 -o hwcgi hwcgimain.o -L. -lhw
– -L switch specifies library location (. is CWD)