2012-03-13 62 views
2

我有一個建立在OSX 10.6上的庫。它可以在該版本的MacOS上運行正常。在OSX 10.7上,它無法正常運行,因爲它無法正確找到所有的依賴關係,我懷疑它與它有關係,認爲它與自身相關聯。爲什麼screens.so會在屏幕上運行「otool -L」時顯示?這是我應該刪除的東西,如果是這樣,怎麼樣?OSX:DLL有一個本身的參考?

screens.so: 
    screens.so (compatibility version 0.0.0, current version 0.0.0) 
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4) 
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) 
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) 
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0) 
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0) 
    /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 1327.73.0) 
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0) 
    /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0) 
    /usr/lib/libwx_macud-2.8.0.dylib (compatibility version 2.6.0, current version 2.8.4) 
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) 
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) 
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 34.0.0) 

回答

1

輸出僅僅是罰款 - 第一行僅僅是動態庫的ID字符串,它顯示了你什麼都會在鏈接時使用嵌入到可執行文件。例如:

$ otool -L /usr/lib/libz.dylib  
/usr/lib/libz.dylib: 
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) 
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0) 

這說明你鏈接-lz將導致二進制/usr/lib/libz.1.dylib加載命令。

但是,回到你的問題 - 它沒有任何關係的第一線,它已經做這行:

/usr/lib/libwx_macud-2.8.0.dylib (compatibility version 2.6.0, current version 2.8.4) 

這是連接中不存在獅子庫 - 是你確定你需要它嗎?

+0

謝謝,我確實要運送一個wx庫。很高興知道看到第一行是好的。 – 2012-03-14 09:10:35