sigemptyset()NDK UnsatisfiedLinkError dlopen() [英] sigemptyset() NDK UnsatisfiedLinkError dlopen()

查看:90
本文介绍了sigemptyset()NDK UnsatisfiedLinkError dlopen()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Android NDK应用程序中的某个C代码调用了signal.h中定义的 sigemptyset()函数.我正在使用 NDK-r9 构建我的项目.

A certain C-code in my Android NDK application, calls the sigemptyset() function defined in the signal.h. I am building my project using the NDK-r9.

在编译了C代码之后,我的名为"libnative-service.so" 的库文件构建良好.但是,在运行该应用程序时,我遇到以下有关引用 sigemptyset()的错误.

My library file called "libnative-service.so" is built fine, after the c-code is compiled. But on running the application i get the following error regarding the refernce to sigemptyset().

我错过了什么吗?

09-22 15:13:09.102: E/art(3718): dlopen("/data/app-lib/com.project/libnative-service.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "sigemptyset" referenced by "libnative-service.so"...
09-22 15:13:09.103: D/AndroidRuntime(3718): Shutting down VM
09-22 15:13:09.106: E/AndroidRuntime(3718): FATAL EXCEPTION: main
09-22 15:13:09.106: E/AndroidRuntime(3718): Process: com.project, PID: 3718
09-22 15:13:09.106: E/AndroidRuntime(3718): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "sigemptyset" referenced by "libnative-service.so"...

推荐答案

此函数似乎是内联声明的:

This function appears to be declared inline:

static __inline__ int sigemptyset(sigset_t *set)
{
    memset(set, 0, sizeof *set);
    return 0;
}

因此,它应该已经在编译的库中解决,而不是运行时链接要填充的依赖项.如果无法解决,则可能是您的库构建不正确.

So it should already be resolved in the compiled library, and not a dependency to be filled by runtime linking. If it is unresolved, it would seem that your library has not built correctly.

您是否可能链接了错误的标题?如果您使用的是非ndk signal.h,则可能无法正确编译该函数的用法.

Did you perhaps link against the wrong headers? If you used a non-ndk signal.h you might not be compiling usage of this function correctly.

这篇关于sigemptyset()NDK UnsatisfiedLinkError dlopen()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆