【发布时间】:2010-12-05 01:44:51
【问题描述】:
我的编译器:xlc 版本 10.1 环境:AIX5.3 链接器:ld
当我在 Linux 上工作时,使用 gcc (4.4.1) 我使用以下选项
-Wl,-rpath
(-Wl 用于链接器选项)它将目录添加到运行时库搜索路径。
xlc 编译器的等价物是什么?
或者是链接器的 -rpath 的等价物。
谢谢。
【问题讨论】:
我的编译器:xlc 版本 10.1 环境:AIX5.3 链接器:ld
当我在 Linux 上工作时,使用 gcc (4.4.1) 我使用以下选项
-Wl,-rpath
(-Wl 用于链接器选项)它将目录添加到运行时库搜索路径。
xlc 编译器的等价物是什么?
或者是链接器的 -rpath 的等价物。
谢谢。
【问题讨论】:
我的第一个答案是: AIX 链接器选项是 -blibpath。
(如果有任何帮助,对于 Sun 编译器,它是 -R。以防万一!)
我现在对其进行了编辑以回应 OP 的评论:你是对的。实际上,阅读 AIX 链接器手册 (man ld) 看起来 -L 已经是正确的选择!
-LDirectory
Adds Directory to the list of search directories used for finding
libraries designated by the -l (lowercase letter L) flag. The list
of directories, including the standard library directories, is
also recorded in the output object file loader section for use by
the system loader unless you use the -blibpath, -bnolibpath, or
-bsvr4 option. You can repeat this flag.
【讨论】: