3:main.c使用此动态连接库的方法如下:
cc -o main.exe libwbc.so main.c
得到可执行文件main.exe
我试验,《unix环境高级编程》上的例程都是上面的方法。作者: --- 时间: 2004-07-28 15:09 标题: Tru64下如何编译使和用自己的动态链接库 参数的作用如下
//在man ld中
-error_unresolved
Produce an error message and return a nonzero error status when
unresolved symbols are encountered, except for those matching
-expect_unresolved. This is the default behavior for linking executable
programs.
#当遇到不明符号时产生error message and return a nonzero error status,是默认参数
-update_registry location_file
Register the location of this shared object's segments and make sure
they stay out of the way of others in the location_file. The
location_file is updated if it is writable. This option is used with
-shared.
#将加产生的so_locations,定位为location_file
You use the following switches to alter the manner in which ld searches
-lx Search a library, libx.{so|a}, where x is a string.
-noarchive
Require -l references to resolve to shared objects. Normally, if the
shared object as specified by the -l is not found, the linker attempts
to find the corresponding archive to resolve undefined symbols. This
option disallows using those archives. Note that this option is posi-
tion sensitive and can be used more than once on a command line. It
affects only those options that follow it, and it is turned off by the
next occurrence of a -noso or -so_archive option.