Installed Android support, now I can't build to windows

As the title indicates:I get the error below. I have double checked that my target was windows but still see some android points in the filepath here.

I tried lime rebuild hxcpp android but get the same error. I guess I need a windows equivalent?

In file included from C:/HaxeToolkit/haxe/cpp/hxcpp/3,4,188/include/hxcpp.h:20:0:
c:\development\android ndk\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x\include\stdint.h:9:26: fatal error: stdint.h: No such file or directory

include_next <stdint.h>

                      ^

compilation terminated.
Error: Could not create PCH
Build halted with errors.

If you’re working from source, try lime rebuild windows, otherwise try Lime 6.3 (supported by OpenFL 8) which has prebuilt libraries

Ok, I updated to Lime 6.3.0 and OpenFL 8, and get the same error. When I downgraded my android NDK to version 15, I get this error:

arm-linux-androideabi-g++: error: ws2_32.lib: No such file or directory
Build halted with errors.

I also tried lime rebuild windows to no avail.

Let’s focus on Windows, what version of Visual Studio Express or Community do you have installed? Does it have support for Windows C++ (Win32) installed?

I should clarify that this is all in relation to trying to build to windows (so I am not sure why it is asking for files relating to android?)

I had visual studio 15 installed, but have removed it and am now updating to 17. Will let you know how this progresses. Thanks again for your help here!

I installed visual studio community 17 and selected Windows C++ as a download option.

I still get the same error when attempting to compile.

Not sure if there are any steps I need to take to rebuid things after the visual studio download. I tried:
lime rebuild windows
lime rebuild android
lime rebuild hxcpp windows
lime rebuild hxcpp android

Seems that this doesn’t have any effect on the error message I receive (I.e. the original top one above - no such file as stdint.h).

Okay, so using a Haxelib version of Lime 6.3, lime rebuild windows should do nothing, because we do not have the “project” directory or the “Build.xml” file.

However, using Lime from source, lime rebuild windows should only run Windows build commands, and disregard Android. You might also try lime rebuild tools, first, if you have not already. You can try lime rebuild windows -verbose to see what it says

Thanks - afraid I need a little more handholding here. I’m not sure what is meant by ‘run lime from source’. I am only familiar with accessing it through haxelib. How would I do what you suggest?

If you are using Lime from haxelib, you should not need to rebuild anything. You should be able to run lime from the command prompt, and should be able to build a simple project for Windows C++, assuming your Visual Studio is setup:

openfl create DisplayingABitmap
cd DisplayingABitmap
openfl test windows

I get the same error - see below:

(Note that if I try to run these commands without prefixing them with haxelib run I get an error along the lines of " ‘openfl’ is not recognized as an internal or external command, operable program or batch file."

Very strange, I have never ever seen this before. Could you try haxelib run openfl setup -cli, and see if it installs the openfl command for you?

Then try openfl test windows -verbose, and let’s see at what step it jumps out and tries to do something for Android.

I imagine my inexperience is the cause of the problem here. I was able to get openfl to work as a separate command - here is the next part:

Hmm, this looks super-weird. You can see that OpenFL says, “WINDOWS” and then we ask HXCPP to build it for us, then it decides to go with Android? I wonder if -Dandroid is defined somehow. What does your Lime config look like? Try running lime config and it should print it all out.

Does it do the same if you try openfl test flash or openfl test html5?

I guess something is wrong here:

Untitled

openfl test html5 seems to work - gives me an openfl logo.

That looks similar to the issue here:

@singmajesty Could it be that Lime 6.3.0 introduced a regression in lime setup android with the rewritten setup command?

Try lime config remove android and see if that helps

This has fixed my ability to build to windows. Thanks!

My ability to build to android, however, seems largely unaffected (that is, before I ran this command building to android crashed at a certain point, and now it crashes at the same point)…

Here’s the message I get when trying to build a toy openfl project (happy to start a new thread if that’s more appropriate)…

Building Blank OpenFL Project
Running Pre-Build Command Line…
cmd: “C:\HaxeToolkit\haxe/haxelib” run lime build “project.xml” android -debug -Dfdb
Creating C:/Users/Bobby/Documents/Blank OpenFL Project/bin/android/obj/obj/android-debug-v7/__pch/haxe/hxcpp.h.gch…

Compiling group: haxe
arm-linux-androideabi-g++ -Iinclude --sysroot=C:\Development\Android NDK/platforms/android-14/arch-arm -IC:\Development\Android NDK/sources/cxx-stl/gnu-libstdc++/4.9/include -IC:\Development\Android NDK/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -IC:/HaxeToolkit/haxe/cpp/hxcpp/3,4,188/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=14 -Wa,–noexecstack -O0 -g -DNDEBUG -c … tags=[haxe,static]

  • src/lime/utils/AssetCache.cpp [haxe,release]
  • src/ApplicationMain.cpp
    Link: libApplicationMain-debug-v7.so

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine java version from ‘10.0.1’.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Build halted with errors.

Perhaps the Android tools work with Java 8 or Java 9, but do you have Java 10 installed?

You’re quite right and this was an easy fix - installing version 8 of the java sdk seems to have fixed this issue too. Thanks again so much for all your persistence with helping here!

We noticed a minor discrepancy in how Lime was handling <define /> instead of <set />

In the next Lime release, <define /> should work as expected, but in the meantime, if you have trouble with the Lime tools saying that “You must run ‘lime setup android’” then edit “~/.lime/config.xml” to use <set /> instead of <define />, no need to put it inside of a named <section /> or <section /> at all