2009-10-08 70 views
5

我的编译器:XLC版本10.1 环境:AIX5.3 链接:LDAIX 5.3(LD-XLC)等效选项的Linux(LD-GCC)-rpath

当我在Linux上工作,具有GCC (4.4.1)我使用(用于链接选项-Wl)以下选项

-Wl,-rpath 

它增加了一个目录到运行时库搜索路径。

xlc编译器的等价物是什么?

或什么是-rpath为链接器。

谢谢。

回答

4

我的第一个答案是:该链接器的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. 
+1

它是不是真的一样,因为你必须指定类似: -blibpath:/ usr/lib目录:/ lib中/:my_lib等.... 我不想破坏现有的库路径 – 2009-10-09 08:48:41

+0

权关于'-blibpath',我相应地编辑了我的答案。 – 2009-10-09 19:08:54

+1

你做到了! -L似乎够用了,-blibpath,-bnolibpath或 -bsvr4选项禁止使用此选项。 – 2009-10-09 19:33:28