我是否需要重新编译可执行文件

时间:2014-10-10 02:32:13

标签: c dynamic-library

我有一个可执行文件(a.out),它链接到一个动态库(b.so),
b.so链接到另一个动态库(c.so)。现在我需要
c.so更改为d.so,是否需要重新编译a.out

以下是整体代码结构(更改前):

/* a.out : main function */
int main(int argc, char *argv[])  
{
    printf("Main start\n");
    callB();  /* callB is located in b.so */
    printf("Main end\n");

    exit(0);
}

/* b.so : callB function*/
void callB()
{
    printf("callB strart\n");
    callC(); /* callC is located in c.so */
    printf("callB end\n");
}

/* c.so : callC function*/
void callC()
{
    printf("callC strart\n");
    /* Do something else */
    printf("callC end\n");
}

以下是整体代码结构(更改后):

/* a.out : main function */
int main(int argc, char *argv[])  
{
    printf("Main start\n");
    callB();  /* callB is located in b.so */
    printf("Main end\n");

    exit(0);
}

/* b.so : callB function*/
void callB()
{
    printf("callB strart\n");
    callD(); /* callD is located in d.so */
    printf("callB end\n");
}

/* d.so : callD function*/
void callD()
{
    printf("callD strart\n");
    /* Do something else */
    printf("callD end\n");
}

请帮帮我,我完全失去了!

0 个答案:

没有答案