-
Notifications
You must be signed in to change notification settings - Fork 250
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
With NDK 13b, C++ cannot find <...> headers #255
Comments
The compiler and editor both show nice little errors like:
In file included from D:\git-repos\thing-browser-android\jni\core\NativeDownloadTask.cpp:2:
D:\git-repos\thing-browser-android\jni\core/NativeDownloadTaskHelper.h:5:10: fatal error: 'memory' file not found
#include <memory>
^
1 error generated.
In file included from D:\git-repos\thing-browser-android\jni\core/Renderer.h:10:
D:\git-repos\thing-browser-android\jni\core/../types/Shader.h:11:10: fatal error: 'string' file not found
#include <string>
^
1 error generated.
And so on… See attached log.
This same project builds fine using NDK 12b.
See [output.txt](https://github.com/android-ndk/ndk/files/637790/output.txt)
|
can you compile using cppFlags.add("-v") and/or CFlags.add('-v') to see your compiler command options? c++_shared works for us in our dlib implementation which uses the same headers/functions which are not found in your build. |
Our android.ndk section which works |
Verbose output attached. |
LLVM-c++ which is what c++_shared is based on is known to be incomplete for r13 (see #82) how about listing all the files here on your machine here D:\Users\jessh\AppData\Local\Android\sdk1\ndk-bundle\sources\cxx-stl\llvm-libc++\libcxx\include ? If the files aren't there, they are probably not included in the c++_shared. But I know we use some of the includes which are missing for you so there is something else going on. |
There is no such directory in NDK 13b (both as per installed by the SDK manager and in the Windows x86_64 download).
D:\Users\jessh\AppData\Local\Android\sdk1\ndk-bundle\sources\cxx-stl\llvm-libc++\include exists, however, and does include a “string” file, but note the lack of “libcxx” in the path.
In NDK 12b, the directory in question is …\sources\cxx-stl\llvm-libc++\libcxx\include, i.e. it does include libcxx in the path.
From: Victor Vedovato [mailto:notifications@github.com]
Sent: Thursday, December 08, 2016 9:43 AM
To: android-ndk/ndk <ndk@noreply.github.com>
Cc: Holle, Jess <jessh@ptc.com>; Author <author@noreply.github.com>
Subject: Re: [android-ndk/ndk] With NDK 13b, C++ cannot find <...> headers (#255)
LLVM-c++ which is what c++_shared is based on is known to be incomplete for r13 (see #82<#82>)
how about listing all the files here on your machine here D:\Users\jessh\AppData\Local\Android\sdk1\ndk-bundle\sources\cxx-stl\llvm-libc++\libcxx\include ?
If the files aren't there, there are probably not included in the c++_shared. But I know we use some of the includes which are missing for you so there is something else going on.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#255 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AKR4UZaF9KebWRzzBMqFLpPwex9lL3bxks5rGCVygaJpZM4LG91r>.
|
These are my entries in r13b / sources / cxx-stl : And in llvm-libc++ (edited for brevity): and in include : |
Maybe you need to "find . -name build | xargs rm -rf" to remove all build directories then run File -> Invalidate Caches and Restart It is possible Android Studio has cached your old paths. Or your path is different under Windoz. |
From my DLIB compile : compiling image_io.cpp successful. |
I exited Android Studio, removed the .idea, .gradle, and build directories, re-imported the project into Android Studio, and the problem persists. I also tried Invalidate Caches and Restart -- so this is not a stale cache problem or at least not one I can do anything about. |
You could try removing your D:\Users\jessh\AppData\Local\Android\sdk1 and completely reloading the SDK and NDK. The problem seems to be the wrong include path. Have you tried hard-coding the -I path to cxx_shared includes ? |
I’ve tried separately loading an NDK and pointing the gradle properties at that instead – and the result was the same.
I’ve not tried hard-coding the -I, as that’s really just a hack.
Perhaps this is as simple as being a platform-specific bug. Has anyone successfully included string, etc, C++ headers from an experimental gradle plugin NDK 13b build on Windows?
|
It's a hack to figure out if something else is wrong - to see if it can work. It is likely your SDK / NDK bundle is mangled in some way as it should not generate bogus -I paths. |
I build our library on OSX 10.10 and Ubuntu 14.04 and 16.04 - no windows around here. |
I can try hacking in -I as a troubleshooting measure. As for the NDK being mangled in some way, I’ve tried both the SDK bundled NDK and separate NDK downloads to no avail.
|
What about a completely clean SDK and NDK install? If that doesn't work, I will dust-off an old windows 7 machine to try our build. |
How does one do a completely clean SDK install when starting with the Android Studio bundled SDK (and then get back to that point later)?
|
move your old SDK from D:\Users\jessh\AppData\Local\Android somewhere temporarily. Launch Android Studio or the SDK Manager and re-download / install all the items you need. |
I tried again with a clean SDK and NDK and got the same basic result. |
Apologies for not responding sooner, I've been on out for most of the week. Thanks a lot to @victorv for helping out :) The core of the issue here (not finding libc++ headers) because they've (as you've noticed) moved from |
Still looking in ndk-bundle\sources\cxx-stl\llvm-libc++\libcxx\include - maybe as @DanAlbert suggests you are running and old Android Studio, gradle plugin, etc.. We are using AS 2.2.2 and
|
I had been using classpath 'com.android.tools.build:gradle-experimental:0.7.0'. This appears to have been the problem. When re-importing the project, Android Studio suggested that I upgrade, but I had been in the habit of ignoring/negating this suggestion as it had caused issues in the past. At this point, however, it seems to work fine and solve the issue! |
yay! |
With NDK 13b, Android Studio 2.2.x (at least 2.2.2 and 2.2.3 and using the experimental NDK plugin) can no longer follow includes of , , , etc.
I am filing this as an NDK bug as all previous NDK versions worked just fine with various Android Studio versions.
I am currently stuck at NDK 12b awaiting some resolution of this issue.
build.gradle excerpt:
build.gradle.snippet.txt
The text was updated successfully, but these errors were encountered: