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

Build error on Android NDK 25 #1139

Closed
raidenluikang opened this issue Feb 8, 2023 · 12 comments · Fixed by #1140
Closed

Build error on Android NDK 25 #1139

raidenluikang opened this issue Feb 8, 2023 · 12 comments · Fixed by #1140
Labels

Comments

@raidenluikang
Copy link

raidenluikang commented Feb 8, 2023

@trueqbit

I just download sqlite_orm.h file from following url

https://github.com/FireDaemon/sqlite_orm/tree/issues/no-rtti

And got an error:

sqlite_orm.h:7938:24: error: no member named 'identity' in namespace 'std' using std::identity;

I'm building for android with NDK 25. -std=c++20 mode. clang 14, but there libc++ is not implemented std::identity.

Could you fix it?

Thanks.

EDIT: And there also not compiling call storage.pragma.foreign_keys() function. Can't find pragma.foreign_keys() function.

@trueqbit
Copy link
Collaborator

trueqbit commented Feb 8, 2023

What is the version of libc++ that comes with the NDK? The Android documentation says that LLVM libc++ is included, and it specifically refers to the progress of the C++20 library implementation of libc++. On the latter page, the line "The identity metafunction" states that it has already been implemented in libc++ v8.

@raidenluikang
Copy link
Author

raidenluikang commented Feb 8, 2023

I couldn't find std::identity in $HOME/Android/Sdk/ndk/25.1.8937393/sources/cxx-stl/llvm-libc++/include folder.

raiden:include$ pwd
/home/raiden/Android/Sdk/ndk/25.1.8937393/sources/cxx-stl/llvm-libc++/include

raiden:include$ grep -rn "\btype_identity\b" .
./type_traits:77:    template<class T> struct type_identity;                     // C++20
./type_traits:79:      using type_identity_t = typename type_identity<T>::type;  // C++20
./type_traits:1473:// type_identity
./type_traits:1475:template<class _Tp> struct type_identity { typedef _Tp type; };
./type_traits:1476:template<class _Tp> using type_identity_t = typename type_identity<_Tp>::type;

raiden:include$ grep -rn "\bidentity\b" .
raiden:include$ 
raiden:include$ 



In other side.

https://libcxx.llvm.org/Status/Cxx20.html

indicates P0887R1 - which about std::type_identity ,

not about std::identity ).

@trueqbit
Copy link
Collaborator

trueqbit commented Feb 8, 2023

My mistake - you are correct that it is std::type_identity.
std::identity came with libcxx 13.

So, what is your version of libcxx (possibly using the macro _LIBCPP_VERSION)?

@raidenluikang
Copy link
Author

raiden:include$ grep -rn "_LIBCPP_VERSION" .
./__config:35:#define _LIBCPP_VERSION 11000
./version:10:#ifndef _LIBCPP_VERSIONH
./version:11:#define _LIBCPP_VERSIONH
./version:241:#endif // _LIBCPP_VERSIONH
raiden:include$ pwd
/home/raiden/Android/Sdk/ndk/25.1.8937393/sources/cxx-stl/llvm-libc++/include
raiden:include$ 

@trueqbit
Copy link
Collaborator

trueqbit commented Feb 8, 2023

Thanks for the information!

It's strange that the Android NDK would use Clang 14, but an old version of libc++.
Anyway, if you could try the branch linked to PR #1140 and let us know how it goes.

@raidenluikang
Copy link
Author

How about storage.execute_raw("PRAGMA user_version = 1;") and storage.pragma.foreign_keys(true) functions, I couldn't find they ( execute_raw and foreign_key) in no rtti version of sqlite_orm.h file ?

How I could to fix they?

Thanks.

@fnc12
Copy link
Owner

fnc12 commented Feb 8, 2023

storage.user_version(1);

Foreign keys are enabled by default if your schema has at least one FK

@raidenluikang
Copy link
Author

Thanks.

Last one, how about storage.execute_tables_from_master_table ?
it was removed ?

@fnc12
Copy link
Owner

fnc12 commented Feb 9, 2023

what does storage.execute_tables_from_master_table mean?

@trueqbit trueqbit added the bug label Feb 9, 2023
@trueqbit trueqbit linked a pull request Feb 9, 2023 that will close this issue
@raidenluikang
Copy link
Author

raidenluikang commented Feb 9, 2023

what does storage.execute_tables_from_master_table mean?

Sorry, It turns out that this was our function, written sqlite_orm.h). Executes

"select sql from sqlite_master where type = 'table' order by tbl_name asc" query.


Can select that sqlite_master table with standard functionality of storage?

Likely, this table https://www.sqlite.org/schematab.html

@fnc12
Copy link
Owner

fnc12 commented Feb 9, 2023

the only way to interact with sqlite_master is storage.table_names() which calls SELECT name FROM sqlite_master WHERE type='table'. Why do you need sqlite_master.sql?

trueqbit added a commit that referenced this issue Feb 10, 2023
Corrected the detection of the availability of `std::identity`
@trueqbit
Copy link
Collaborator

Request for sqlite_master to be followed up in #1142.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants