herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
450 stars 152 forks source link

setLittleEndianMod() error, while ndk-build command execution #121

Closed Henzi96 closed 3 years ago

Henzi96 commented 3 years ago

Hello, I tried to create a compiled version of the mcl library using the ndk-build tool, but when I called the "ndk-build" command the system threw me this error:

user@UbuntuServerGUI:~/Desktop/honza/mcl/ffi/java/android/jni$ /home/user/Desktop/honza/android-ndk-r21e/build/ndk-build
[arm64-v8a] Compile++      : mcljava <= mcl_wrap.cxx
In file included from /home/user/Desktop/honza/mcl/ffi/java/android/jni/../../../..//ffi/java/mcl_wrap.cxx:244:
/home/user/Desktop/honza/mcl/ffi/java/android/jni/../../../..//ffi/java/mcl_impl.hpp:34:4: error: no matching member function for call to 'setLittleEndianMod'
        x.setLittleEndianMod(cbuf, bufSize);
        ~~^~~~~~~~~~~~~~~~~~
/home/user/Desktop/honza/mcl/ffi/java/android/jni/../../../..//ffi/java/mcl_impl.hpp:107:3: note: in instantiation of function template specialization 'setLittleEndianModT<mcl::FpT<mcl::bn::local::FrTag, 256> >' requested here
                setLittleEndianModT(self_, cbuf, bufSize);
                ^
/home/user/Desktop/honza/mcl/ffi/java/android/jni/../../../..//include/mcl/fp.hpp:519:7: note: candidate function not viable: no known conversion from 'const char *' to 'const uint8_t *' (aka 'const unsigned char *') for 1st argument
        void setLittleEndianMod(const uint8_t *buf, size_t bufSize)
             ^
/home/user/Desktop/honza/mcl/ffi/java/android/jni/../../../..//include/mcl/fp.hpp:484:7: note: candidate function not viable: requires 3 arguments, but 2 were provided
        void setLittleEndianMod(bool *pb, const uint8_t *x, size_t xn)
             ^
1 error generated.
make: *** [/home/user/Desktop/honza/android-ndk-r21e/build/core/build-binary.mk:478: /home/user/Desktop/honza/mcl/ffi/java/android/obj/local/arm64-v8a/objs/mcljava//home/user/Desktop/honza/mcl/ffi/java/android/jni/__/__/__/__//ffi/java/mcl_wrap.o] Error 1
user@UbuntuServerGUI:~/Desktop/honza/mcl/ffi/java/android/jni$ 

Do you know, where is the problem ?

herumi commented 3 years ago

Does this commit solve the problem? https://github.com/herumi/mcl/commit/083f79c2657b32820f1674c4bdf5f4396a2a5af9

Henzi96 commented 3 years ago

Yes, thanks !