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

[Android branch] undefined reference to stderr, stdin, stdout.. #8

Closed
faizol opened this issue Nov 4, 2020 · 4 comments
Closed

[Android branch] undefined reference to stderr, stdin, stdout.. #8

faizol opened this issue Nov 4, 2020 · 4 comments

Comments

@faizol
Copy link

faizol commented Nov 4, 2020

Hi,
I downloaded and compiled your android branch of the plugin and got into errors. The 64 bit versions of the plugin (arm64-v8a and x86_64) can only be linked against shared library of sqlcipher (libsqlcipher.so) instead of the static libsqlcipher.a. Otherwise the linker will throw undefined reference to stderr, stdin, stdout etc.

The minimum required android API for the 64 bit version was set to 23, but I also got the same error messages if I increased the minimum API to 26.

Any pointers on how should I go about to solve this?

TIA.

regards,
Faizol

@sjemens
Copy link
Owner

sjemens commented Nov 4, 2020

@faizol Can you tell me a little bit about your build environment like which Qt version you are using and in which OS you try to cross compile?

@faizol
Copy link
Author

faizol commented Nov 4, 2020

Sorry for didn't include earlier the details about the build environment.
My build system is as the following;
OS : Fedora 33
Qt : 5.15.1
Target OS : Android
- with API = 19 for x86 and armeabi-v7a, both compiled with no problem.
- with API = 23 for x86_64 and arm64-v8a, both failed with undefined reference to stderr, stdin, stdout when using static libsqlcipher.a lib. Both can be linked with shared version of sqlcipher lib.

@sjemens
Copy link
Owner

sjemens commented Nov 8, 2020

@faizol There is a new android-5,15 branch.
The included static libraries are built with NDK r21.1.6352462 . SQLCipher is version 4.4.0 and OpenSSL is version 1.1.1h
The ANDROID_SDK_VERSION=21 for all ANDROID_ABIS.
You will probably have no problem if you use NDK > r20b
The undefined reference to stderr is a rather common error when linking with a newer version of NDK to an older static library. The reason is that in stdio.h, stderr have different names depending on NDK version. See issue

Let me know if this works for you.

@faizol
Copy link
Author

faizol commented Nov 11, 2020

Hi,
The new branch solved the problem.
Thank you.

@faizol faizol closed this as completed Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants