Chinaunix首页 | 论坛 | 博客
  • 博客访问: 237988
  • 博文数量: 68
  • 博客积分: 884
  • 博客等级: 准尉
  • 技术积分: 700
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-25 14:34
文章分类

全部博文(68)

文章存档

2016年(3)

2015年(4)

2014年(9)

2013年(8)

2012年(6)

2011年(19)

2010年(19)

我的朋友

分类: C/C++

2011-10-20 22:55:34

One sample :

cc -I$SYBASE/$SYBASE_OCS/include
-L$SYBASE/$SYBASE_OCS/lib program.c
-Wl,-Bstatic -lsybsrv [ -lsybdb|-lsybct ] -lsybcs -lsybtcl -lsybcomn -lsybintl -lsybunic 
-Wl,-Bdynamic -ldl -lnsl -lm -o program

Note - if the linker is being invoked indirectly, via a compiler driver (eg gcc) then all the linker command line options should be prefixed by -Wl, (or whatever is appropriate for the particular compiler driver) like this:
gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup


This is important, because otherwise the compiler driver program may silently drop the linker options, resulting in a bad link.


-Wl,option

Pass option as an option to the linker. If option contains commas, it is split into multiple options at the commas.

Assuming that default setting of ld is to use dynamic libraries (it is on Linux).

Refer to for more info about ld..

阅读(1196) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~