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

Cannot compile for Android #1736

Open
RuiCuco opened this issue Dec 24, 2023 · 1 comment
Open

Cannot compile for Android #1736

RuiCuco opened this issue Dec 24, 2023 · 1 comment

Comments

@RuiCuco
Copy link

RuiCuco commented Dec 24, 2023

I do on a new project:

lime build android

and after a while I receive these errors:

Compiling group: pcre2-8
arm-linux-androideabi-g++ -DPCRE2_CODE_UNIT_WIDTH=8 -DSUPPORT_PCRE2_8 -DHAVE_CONFIG_H -DPCRE2_STATIC -DSUPPORT_UNICODE -ID:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src --sysroot=D:\Developer\Android\android-ndk-r15c/platforms/android-21/arch-arm -ID:\Developer\Android\android-ndk-r15c/sources/cxx-stl/gnu-libstdc++/4.9/include -ID:\Developer\Android\android-ndk-r15c/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_ARMV7 -DHXCPP_VISIT_ALLOCS(haxe) -DHX_SMART_STRINGS(haxe) -DHXCPP_API_LEVEL=430(haxe) -ID:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -Wno-overflow -D_LINUX_STDDEF_H -Wno-psabi -DHXCPP_CPP11 -DHXCPP_ARMV7 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=21 -Wa,--noexecstack -O2 -DNDEBUG -c ... tags=[haxe,static]

  • D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c
    Error: D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c: In function 'compile_branch':
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5859:13: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++) pbits[i] |= cbits[(int)i + taboffset];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5859:13: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5861:22: error: redefinition of 'i'
    for (int i = 0; i < 32; i++) pbits[i] &= ~cbits[(int)i + taboffset];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5859:22: note: previous definition of 'i' was here
    for (int i = 0; i < 32; i++) pbits[i] |= cbits[(int)i + taboffset];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5861:13: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++) pbits[i] &= ~cbits[(int)i + taboffset];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5875:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++) classbits[i] |= (uint8_t)(~pbits[i]);
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5877:20: error: redefinition of 'i'
    for (int i = 0; i < 32; i++) classbits[i] |= pbits[i];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5875:20: note: previous definition of 'i' was here
    for (int i = 0; i < 32; i++) classbits[i] |= (uint8_t)(~pbits[i]);
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5877:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++) classbits[i] |= pbits[i];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5916:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_digit];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5921:20: error: redefinition of 'i'
    for (int i = 0; i < 32; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5916:20: note: previous definition of 'i' was here
    for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_digit];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5921:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5926:20: error: redefinition of 'i'
    for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_word];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5921:20: note: previous definition of 'i' was here
    for (int i = 0; i < 32; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5926:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_word];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5931:20: error: redefinition of 'i'
    for (int i = 0; i < 32; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5926:20: note: previous definition of 'i' was here
    for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_word];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5931:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5943:20: error: redefinition of 'i'
    for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_space];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5931:20: note: previous definition of 'i' was here
    for (int i = 0; i < 32; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5943:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_space];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5948:20: error: redefinition of 'i'
    for (int i = 0; i < 32; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5943:20: note: previous definition of 'i' was here
    for (int i = 0; i < 32; i++) classbits[i] |= cbits[i+cbit_space];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:5948:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:6190:11: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++) classbits[i] = 255 ^ classbits[i];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:6216:8: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < 32; i++) classbits[i] = 255 ^ classbits[i];
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:6290:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < (int)verbarglen; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:6773:7: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (unsigned int i = 0; i < cb->names_found; i++, ng++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:7132:14: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    else for (int i = 0; i < replicate; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:7313:15: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (uint32_t i = 1; i < repeat_min; i++)
    ^
    D:/Developer/HaxeToolkit/haxe/lib/hxcpp/4,3,2/project/thirdparty/pcre2-10.42/src/pcre2_compile.c:7357:16: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    else for (uint32_t i = repeat_max; i >= 1; i--)
    ^

What should I do to compile correctly for Android and thereby generate an APK?

@joshtynjala
Copy link
Member

This is an hxcpp bug. It’s been fixed, but not released to Haxelib yet.

HaxeFoundation/hxcpp#1041

You can either install hxcpp from GitHub, or you can roll back to Haxe 4.2 and hxcpp 4.2.

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