請問大家ndk中LOCAL_SHARED_LIBRARIES LOCAL_LDLIBS什么區別


請問大家ndk中LOCAL_SHARED_LIBRARIES LOCAL_LDLIBS什么區別啊
我先是編譯了一個.so 然后在此次編譯的使用調用,請問用LOCAL_SHARED_LIBRARIES和LOCAL_LDLIBS什么區別啊,我用后者能編譯通過,用前者不行呢,謝謝!!

1.共享庫放在其他程序里面也應該可以調用   非共享庫只能在本程序調用   
   我想是這樣的  不知道對不對

2.我用LOCAL_LDLIBS,編譯的時候,提示:ndroideabi/bin/ld.exe: cannot find -lssl

3.我剛看了下源碼,目錄/framework/base/media/jni下有個Android.mk文件,里面有這樣一句話:LOCAL_LDLIBS := -lpthread;這讓我聯想到了編譯c線程程序時需要加編譯參數-lpthread(引入libpthread.so共享庫)。 LOCAL_LDLIBS := -lpthread作用也是引入libpthread.so庫,也是不知兩者區別在哪里,,求高手解答。。。。。

4.剛查了下,有的人講:“由於要調用第三方庫,所以用到了 LOCAL_LDLIBS” 。

5.in your case, in your “mydrdoid”, if you use:LOCAL_LDLIBS := -lskia” …then, libskia.so *need not* be rebuilt.
whereas, if you use:LOCAL_SHARED_LIBRARIES := libskia … then libskia.so *will* be rebuilt if there are any changes in it’s dependencies.

6.RaviY
thanks for your explanation

also i found that LOCAL_LDLIBS in mydroid can only work for
HOST_SHARED_LIBS
but not for TARGET SHARED LIBS

thanks

On Nov 30, 11:52 am, RaviY <yend...@xxxxxx> wrote:
> Libraries that are linked via LOCAL_LDLIBS will not have any
> dependencies generated for them. So, typically, LOCAL_LDLIBS should be
> used when you don't want to or don't have the resources to build the
> specific library. So, if you are using a library provided by the NDK,
> you *technically* don't need to rebuild the provided libraries.
>
> So, in your case, in your "mydrdoid", if you use:
> LOCAL_LDLIBS := -lskia" ...then, libskia.so *need not* be rebuilt.
> whereas, if you use:
> LOCAL_SHARED_LIBRARIES := libskia ... then libskia.so *will* be
> rebuilt if there are any changes in it's dependencies.
>
> -Ravi
>
> On Nov 30, 7:20 am, allstars <allstars....@xxxxxxxxx> wrote:
>
> > hello
> > i would like to ask the differences between
> > LOCAL_SHARED_LIBRARIES and LOCAL_LDLIBS
>
> > for example , i try to link skia
>
> > in mydroid
>
> >  i need to use LOCAL_SHARED_LIBRARIES = libskia
>
> > but in NDK
> > i need to use LOCAL_LDLIBS = -lskia
>
> > so i am wondering what's the differences
> > and why do i need to two different ways for my Android.mk
>
> > thanks
>

 

FROM:http://www.eoeandroid.com/thread-45413-1-1.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM