2014-03-31 43 views
0

圖書館既是靜態的又是共享的,這意味着什麼?從我讀到的,這兩個是互斥的。 People tend to define one as the opposite of the other圖書館如何既是靜態的又是共享的?

但是閱讀LAME的配置選項,我看到了這一點。

$ ./configure --help 
    `configure' configures lame 3.99.5 to adapt to many kinds of systems. 
    [...] 
    --enable-shared[=PKGS] build shared libraries [default=yes] 
    --enable-static[=PKGS] build static libraries [default=yes] 
    [...] 

回答

0

這些標記所做的是構建共享庫和靜態庫,它們不會嘗試使單個庫既是靜態的也是共享的。

正如你所說,它們在某種意義上是「相互排斥的」 - 沒有一個文件既可以是靜態的也可以是共享的。

在啓用靜態庫和共享庫編譯的Linux系統上,您將同時爲* .a和a * .so文件,* .so文件用於動態(共享)鏈接,而* .a文件用於靜態鏈接。

相關問題