clang.exe:错误:Visual Studio 2015跨平台模板中没有此类文件或目录 [英] clang.exe : error : no such file or directory in Visual Studio 2015 cross-platform template

查看:152
本文介绍了clang.exe:错误:Visual Studio 2015跨平台模板中没有此类文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了VS 2015跨平台工具,并使用本机活动应用程序(Android)模板创建了一个新项目。然后,我尝试不做任何更改就编译该应用程序。我收到以下错误:

I installed the VS 2015 Cross-Platform tools and created a new project using the Native-Activity Application (Android) template. I then tried to compile the application with no changes. I get the following errors:

1>------ Build started: Project: Android1.NativeActivity, Configuration: Debug x64 ------
1>  ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
1>  ANT_HOME=C:\apache-ant-1.9.6
1>  JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_65
1>  NDK_ROOT=C:\android-ndk-r14b-windows-x86_64\android-ndk-r14b
1>  pch.h
1>clang.exe : error : no such file or directory: 'C:UsersTomdocumentsvisual studio 2015ProjectsAndroid1Android1Android1.NativeActivitypch.h'
1>clang.exe : error : no input files

我注意到,在没有这样的文件或目录:行上,它正在寻找的文件看起来像删除所有 \字符的pch.h的完整路径。如何防止这种情况发生?看来这是在Windows平台上使用clang.exe的产物。

I noticed that, on the "no such file or directory:" line, the file it is looking for looks like the full path to pch.h with all of the "\" characters removed. How do I prevent this from happening? It seems like this is an artifact of using clang.exe on a windows platform.

推荐答案

我遇到了同样的问题,可以解决当我从 android-ndk-r14b切换到 android-ndk-r13b时。也许它也可以与旧版本的Android NDK一起使用,但我没有尝试过。

I faced the same problem and could resolve it when I switched from "android-ndk-r14b" to the "android-ndk-r13b". Maybe it works also with older versions of Android NDK, but I haven't tried.

我的猜测是, android-ndk-r14b中的 clang.exe版本希望在文件路径中的反斜杠前使用转义符号- C:\\ Users\\Documents ...,而不是 C:\Users\Documents ...

My guess is that "clang.exe" version from "android-ndk-r14b" expects escape symbol before backslash in the file path - "C:\\Users\\Documents..." instead of "C:\Users\Documents..."

这篇关于clang.exe:错误:Visual Studio 2015跨平台模板中没有此类文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆