(...)new:42: error: expected declaration before end of line

I’m trying to compile my project to android, but I get this error:
(...)\androidNDK\android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.4.3/include/new:42: error: expected declaration before end of line

Any ideas what might be the problem?

Here is a full log:
cmd: "D:\Programy\Haxe\haxe/haxelib" run lime build "project.xml" android -debug -Dfdb arm-linux-androideabi-g++ -Iinclude --sysroot=D:\Programy\androidNDK\android-ndk-r8e/platforms/android-9/arch-arm -ID:\Programy\androidNDK\android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.4.3/include -ID:\Programy\androidNDK\android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=321 -ID:/Programy/Haxe/haxe/lib/hxcpp/3,2,205/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums "-D_LINUX_STDDEF_H " -Wno-psabi -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -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=14 -Wa,--noexecstack -O0 -g -DNDEBUG -c -x c++ -Wno-invalid-offsetof -frtti ./src/lime/_backend/native/NativeApplication.cpp "-oD:/doxy/Uczelnia/UJ - FAIS/3 sem/ai2/bin/android/obj/obj/android-debug-v7/3f21e8d3_NativeApplication.obj" Error: In file included from include/openfl/events/EventDispatcher.h:9, from include/openfl/display/DisplayObject.h:9, from include/openfl/display/InteractiveObject.h:9, from include/openfl/display/DisplayObjectContainer.h:9, from include/openfl/display/Sprite.h:9, from include/time.h:9, from D:\Programy\androidNDK\android-ndk-r8e/platforms/android-9/arch-arm/usr/include/wchar.h:40, from D:/Programy/Haxe/haxe/lib/hxcpp/3,2,205/include/hxcpp.h:46, from ./src/lime/_backend/native/NativeApplication.cpp:1: include/openfl/events/IEventDispatcher.h:8: error: expected constructor, destructor, or type conversion before '(' token In file included from D:\Programy\androidNDK\android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.4.3/include/bits/stl_construct.h:60, from D:\Programy\androidNDK\android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.4.3/include/bits/stl_tempbuf.h:61, from D:\Programy\androidNDK\android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.4.3/include/bits/stl_algo.h:63, from D:\Programy\androidNDK\android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.4.3/include/algorithm:62, from D:/Programy/Haxe/haxe/lib/hxcpp/3,2,205/include/Array.h:298, from D:/Programy/Haxe/haxe/lib/hxcpp/3,2,205/include/hxcpp.h:287, from ./src/lime/_backend/native/NativeApplication.cpp:1: D:\Programy\androidNDK\android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.4.3/include/new:42: error: expected declaration before end of line

Thanks in advance for any help.

This sounds like it may be an issue with use of a reserved keyboard. Could you share the contents of your IEventDispatcher.h file? Thanks

What happens if you move to Android NDK r10e?

Hey. Thanks for helping me with this. I’ve switched to NDK r10e - and nothing has changed, exept the loss of 2gb space on my drive :wink: Here is my generated IEventDispatcher.h:

What do you mean by reserved keyboard?

For example, if I add -Dhello to a C++ build, then int hello = 100; will compile as if you wrote int = 100; and fail to compile. Some names of variables can sometimes tread on names of things defined somewhere else, so it varies by compiler and what generated source you have, at times. Thanks

Hmmm… I’m not quite sure what should I be looking for then. I dont seem to have any forbidden class names etc.
I thing that you should also know, that it compiles to windows cpp - exept the fact, that the app failes because of some OpenAL runtime error: “AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005” - and it does thesame on Neko.

Could you please share the contents of your “include/openfl/events/IEventDispatcher.h” file? Thanks :slight_smile:

Mmmm… I did this two replies ago, didn’t I? :wink:
Here you go: https://codeshare.io/NOf0K

I’m sorry I didn’t notice it. This doesn’t really make much sense. If you try to use lime test android -clean does it work any differently?

Omg. Why I didn’t try to clean the project earlier? It worked. It compiles fine now. Thank you. :slight_smile:

My first guess is a change in HXCPP or Haxe versions that somehow caused a problem, but I’m not sure! I’m just glad to know there’s some sanity in the world, still :sweat_smile: