请问大家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
>