to: bdsc() 
请说一下细节好么,如何实现用so封装成.a的静态库呢 
我快撑不住了,感谢!!!

解决方案 »

  1.   

    非常奇怪:
    在google里搜索 jni .a ,几乎没有任何同时包含jni和.a的信息,世界可是很大的啊,难道只有我有这样的需求?另一种可能就是,java处理.a库有别的大家都很熟的处理技术,大家都不像我这么傻?到底是怎么样的呢
      

  2.   

    你的so里
    #include staticA.h
    //call staticA里的函数没有什么细节
      

  3.   

    jni --call-->*.so --call-->*.a为什么不行,奇怪
      

  4.   

    再请教一下,编译的时候需要链接静态库,又要链接动态库
    这样的话gcc的编译参数怎么设置?
      

  5.   

    to dbsc():
    我封装的demo都执行不了,给个答案吧 谢谢了,我的分怎么又送不出去呢![will@databack atoso]$ more libso.c
    #include <stdio.h>
    #include "libso.h"
    #include "libatest.h"void calla()
    {
        atest(); //call from a static library(libatest.a)
        printf(".a convet to .so is ok\n");
        return;}
    [will@databack atoso]$ more run.c
    #include <stdio.h>
    #include "libso.h"
    #include "libatest.h"int main()
    {
        calla();
        printf("oh ,3ks\n");
        return 0;
    }[will@databack atoso]$ gcc run.c -o run -I. -L. -static -latest -shared -lso[will@databack atoso]$ ls -lF
    总用量 44
    -rw-r--r--    1 will     will          950  7月 18 22:24 libatest.a
    -rw-r--r--    1 will     will           13  7月 18 22:24 libatest.h
    -rw-r--r--    1 will     will          144  7月 18 22:30 libso.c
    -rw-r--r--    1 will     will           14  7月 18 22:27 libso.h
    -rw-r--r--    1 will     will          900  7月 18 22:31 libso.o
    -rw-r--r--    1 will     will         6648  7月 18 22:32 libso.so
    -rw-r--r--    1 will     will          116  7月 18 23:15 log.txt
    -rwxr--r--    1 will     will         6582  7月 18 23:11 run*
    -rw-r--r--    1 will     will          128  7月 18 22:39 run.c
    [will@databack atoso]$ ./run
    段错误这样(gcc run.c -o run -I. -L. -static -latest -shared -lso)编译后为什么运行出错呢?