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

mbedtls error when compiling to Android #1064

Closed
DigiEggz opened this issue Sep 16, 2023 · 1 comment · Fixed by #1111
Closed

mbedtls error when compiling to Android #1064

DigiEggz opened this issue Sep 16, 2023 · 1 comment · Fixed by #1111

Comments

@DigiEggz
Copy link

DigiEggz commented Sep 16, 2023

When targeting Android on macOS, I receive the following error:

Error: /Users/E/Documents/Haxe/hxcpp/4,3,12/project/thirdparty/mbedtls-2.28.2/library/bignum.c: In function 'mpi_select':

/Users/E/Documents/Haxe/hxcpp/4,3,12/project/thirdparty/mbedtls-2.28.2/library/bignum.c:1990:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
     for( size_t i = 0; i < T_size; i++ )
     ^
/Users/E/Documents/Haxe/hxcpp/4,3,12/project/thirdparty/mbedtls-2.28.2/library/bignum.c:1990:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

I'm willing to test any suggested fixes.

Edit: May be necessary to update the mbedtls library.

@DigiEggz
Copy link
Author

DigiEggz commented Sep 20, 2023

For anyone else having this issue, a fix is to include the compiler flag <compilerflag value="-std=c99" unless="MSVC_VER" /> within src/hx/libs/ssl/Build.xml, like used in #1041.

Ideally the entire mbedtls library within hxcpp will be updated, but it will also require the C99 fix. For more info, see this issue.

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

Successfully merging a pull request may close this issue.

1 participant