Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typedef redefinition with different types #186

Closed
Pitel opened this issue Jun 2, 2017 · 7 comments
Closed

typedef redefinition with different types #186

Pitel opened this issue Jun 2, 2017 · 7 comments
Labels

Comments

@Pitel
Copy link

Pitel commented Jun 2, 2017

I'm trying to build Opus for Android and I'm getting the following error:

In file included from /home/pitel/project/app/src/main/jni/jniopus.cpp:26:
/home/pitel/Android/Sdk/ndk-bundle/sysroot/usr/include/jni.h:36:18: error: typedef redefinition with different types ('int64_t' (aka 'long') vs 'long long')
typedef int64_t  jlong;    /* signed 64 bits */
                 ^
/home/pitel/project/app/src/main/jni/jniopus.cpp:22:23: note: previous definition is here
    typedef long long jlong;
                      ^

It's happening with NDK r15-beta2, r13b is ok, r14b is uknown, beacause the build fails somewhere in opus.

@saudet saudet added the bug label Jun 2, 2017
@saudet
Copy link
Member

saudet commented Jun 3, 2017

Let's see, could you tell me what you get if you remove these lines from the generated .cpp file?

#elif defined(__GNUC__)
    #define _JAVASOFT_JNI_MD_H_

    #define JNIEXPORT __attribute__((visibility("default")))
    #define JNIIMPORT
    #define JNICALL

    typedef int jint;
    typedef long long jlong;
    typedef signed char jbyte;

@Pitel
Copy link
Author

Pitel commented Jun 5, 2017

It finishes ok.

@saudet
Copy link
Member

saudet commented Jun 5, 2017

This is for 32-bit platforms right? int64_t gets defined as long long on those, so that works, but on 64-bit platforms, it's most likely long, and then that's going to be problematic...

@Pitel
Copy link
Author

Pitel commented Jun 5, 2017

I build it for arm64-v8a, armeabi-v7a, armeabi, x86 and x86_64. I'll try running it on Nexus 5X phone, which should be arm64.

@Pitel
Copy link
Author

Pitel commented Jun 5, 2017

It works on both 32bit and 64bit ARMs.

saudet added a commit that referenced this issue Jun 7, 2017
@saudet
Copy link
Member

saudet commented Jun 7, 2017

Great, thanks for testing! The commit above includes the fix.

@saudet
Copy link
Member

saudet commented Jul 27, 2017

Fix released in version 1.3.3. Thanks for reporting!

@saudet saudet closed this as completed Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants