undefined reference to `siglongjmp' error when compiling android cocos2dx project for x86 architecture

StackOverflow https://stackoverflow.com/questions/14808884

Question

I am trying to build a cocos2dx project for x86 android architecture but i get the following error when i try to compile it.

./obj/local/x86/curl.a(hostip.o):(.text.alarmfunc+0x21): undefined reference to `siglongjmp'
./obj/local/x86/curl.a(hostip.o): In function `Curl_resolv_timeout':
(.text.Curl_resolv_timeout+0x156): undefined reference to `sigsetjmp'

When i googled the error i found that it has been reported as issue 19851 in google code. They have not made any fixes yet but they had suggested to add a modified libc.so and sched.h file. I tried this and it did not work.

Can anyone tell me how to fix this.

Was it helpful?

Solution 2

Fixed the issue by copying libc.so attached in response to issue 19851 to latest version of ndk. I was using ndkr8 and copying the libc.so file to ndkr8d fixed the issue.

OTHER TIPS

Try adding this code to one of your .c or .cpp modules:

#if __i386 && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include <setjmp.h>
#ifdef __cplusplus
extern "C" {
    void siglongjmp(jmp_buf env, int val);
    int sigsetjmp(jmp_buf env, int savemask);
}
#endif
void siglongjmp(jmp_buf env, int val)
{
    longjmp(env, val);
}
int sigsetjmp(jmp_buf env, int savemask)
{
    return setjmp(env);
}
#endif

Go to the Android NDK page & follow the download and installation instructions.

https://developer.android.com/tools/sdk/ndk/index.html

I'm on OSX, android-ndk-r10e-darwin-x86_64.bin fixed the error for my setup.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top