search

Home  >  Q&A  >  body text

Android NDK开发,JNI调用C++程序编译出现error: ld returned 1 exit status?

各位大神,小弟现在做Android的ndk开发,使用的是Studio,现在是使用jni调用已存在的原生c++代码,生成头文件后,把c++代码拷过来进行调用的时候,编译一直出现Error:error: ld returned 1 exit status,不能编译通过,也加extern "C" 了,ndk路径什么都没问题,而且c++代码在VS上进行编译的时候就能通过,困扰了好久,网上也找不到答案,希望大家帮帮忙。。

Error:error: ld returned 1 exit status
Error:Execution failed for task ':showbaby01:ndkBuild'.
> Process 'command 'D:\.../ndk-build.cmd'' finished with non-zero exit value 2
ringa_leeringa_lee2772 days ago529

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-17 17:33:22

    Post more error information.

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 17:33:22

    It is recommended to take a good look at "Advanced Programming with Android C++: Using NDK". Many issues that need attention will be answered for you one by one

    reply
    0
  • Cancelreply