码迷,mamicode.com
首页 > 其他好文 > 详细

bstatic, bdynamic

时间:2019-05-02 00:09:01      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:until   iter   wing   tin   edit   settings   names   err   this   

bstatic, bdynamic

Option Type Default Value #pragma options C C++
-flag bdynamic - x x

Syntax

    -bstatic | -bdynamic

Purpose
Controls how libraries are processed by specifying which forms of library names the linkage editor looks for.

Notes
The linkage editor searches library names and paths specied by the -l and -L options according to the following criteria:

bdynamic For settings of the -lkey option appearing after the -bdynamic option, both libkey.so and libkey.a library files are searched for by the linkage editor. This option remains in effect until overridden by the appearance of the -bstatic option, which in turn affects -lkey options appearing after it.
bstatic For settings of the -lkey option appearing after the -bstatic option, only libkey.a library files are searched for by the linkage editor. This option remains in effect until overridden by the appearance of the -bdynamic option, which in turn affects -lkey options appearing after it.

The default option, -bdynamic, ensures that the C library (lib.c) links dynamically. To avoid possible problems with unresolved linker errors when linking the C library, you must add the -bdynamic option to the end of any compilation sections that use the -bstatic option.

Example
To compile myprogram.c using a static version of the libtask.a Task Library and a dynamic version version of the libcomplex.a Complex Mathematics Library, enter:

xlC myprogram.c -bstatic -ltask -bdynamic -lcomplex

bstatic, bdynamic

标签:until   iter   wing   tin   edit   settings   names   err   this   

原文地址:https://www.cnblogs.com/aerfa828/p/10801229.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!