Programming and posix - April 2002
April 3, 2002
Solution Symposium
Page 25
hp e3000
programming
and posix
linking with libraries - syntax
• -lfoo means link with library libfoo.a
• -lc is included in link by default
• -Lpath tells where library is located
• -L/lib -L/usr/lib is included in link by default
• Link with libsvipc archive library
shell/iX> gcc -o hwcgi hwcgi.c -lsvipc
• Link with libsvipc shared library
shell/iX> gcc -o hwcgi hwcgi.c -Wl,-ashared
-lsvipc
• -Wl,-ashared specifies shared library preference