AndroidIDE
AndroidIDE copied to clipboard
为什么我用AndroidIDE创建的c++项目 无法用c++语言去构建 是我哪里输入错了吗?
Issue Checklist
- [X] I confirm that this issue is not a duplicate and hasn't been reported before.
- [X] I agree to follow the project's code of conduct.
- [X] I have checked and verified that I am using the latest version of AndroidIDE from GitHub or F-Droid.
Additional terms
- [X] I understand that providing incomplete or inaccurate information may result in the issue being closed.
- [X] I agree to provide all requested details promptly for a comprehensive bug report.
Issue explanation
Expected behavior
AndroidIDE他自身创建的c++模板或者说工程就可以被构建 我删除里面的语法 用c++简单的语法就不能被构建 我不知道是哪里的问题。
Version name
2.71
Download source
GitHub
Relevant log output
运行任务 : [:app:assembleDebug]
> Configure project :app
WARNING:The option setting 'android.aapt2FromMavenOverride=/data/data/com.itsaky.androidide/files/home/.androidide/aapt2' is experimental.
Adding LogSender dependency (version '2.7.1-beta') to variant 'debug' of project ':app'
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:dataBindingMergeDependencyArtifactsDebug UP-TO-DATE
> Task :app:dataBindingMergeGenClassesDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:packageDebugResources UP-TO-DATE
> Task :app:parseDebugLocalResources UP-TO-DATE
> Task :app:dataBindingGenBaseClassesDebug UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:checkDebugAarMetadata UP-TO-DATE
> Task :app:mapDebugSourceSetPaths UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugMainManifest UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugManifestForPackage UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:compressDebugAssets UP-TO-DATE
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:checkDebugDuplicateClasses UP-TO-DATE
> Task :app:desugarDebugFileDependencies UP-TO-DATE
> Task :app:mergeExtDexDebug UP-TO-DATE
> Task :app:mergeLibDexDebug UP-TO-DATE
> Task :app:configureCMakeDebug[arm64-v8a]
> Task :app:buildCMakeDebug[arm64-v8a] FAILED
C/C++: ninja: Entering directory `/storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/.cxx/Debug/15k3i76g/arm64-v8a'
C/C++: /storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:3:2: error: invalid preprocessing directive
C/C++: /storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:4:7: error: using declaration requires a qualified name
C/C++: /storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:4:16: error: expected ';' after using declaration
C/C++: /storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:7:5: error: use of undeclared identifier 'cout'
C/C++: /storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:7:20: error: use of undeclared identifier 'endl'
> Task :app:processDebugResources
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:buildCMakeDebug[arm64-v8a]'.
> Build command failed.
Error while executing process /data/data/com.itsaky.androidide/files/home/android-sdk/cmake/3.23.1/bin/ninja with arguments {-C /storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/.cxx/Debug/15k3i76g/arm64-v8a myapplication5588}
ninja: Entering directory `/storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/.cxx/Debug/15k3i76g/arm64-v8a'
[1/2] Building CXX object CMakeFiles/myapplication5588.dir/native-lib.cpp.o
FAILED: CMakeFiles/myapplication5588.dir/native-lib.cpp.o
/data/data/com.itsaky.androidide/files/home/android-sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/linux-aarch64/bin/clang++ --target=aarch64-none-linux-android24 --sysroot=/data/data/com.itsaky.androidide/files/home/android-sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/linux-aarch64/sysroot -Dmyapplication5588_EXPORTS -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -g -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/myapplication5588.dir/native-lib.cpp.o -MF CMakeFiles/myapplication5588.dir/native-lib.cpp.o.d -o CMakeFiles/myapplication5588.dir/native-lib.cpp.o -c /storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp
/storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:3:2: error: invalid preprocessing directive
#iuclude <iostream>
^
/storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:4:7: error: using declaration requires a qualified name
using namespeca std;
^
/storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:4:16: error: expected ';' after using declaration
using namespeca std;
^
;
/storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:7:5: error: use of undeclared identifier 'cout'
cout<<"imyyp"<<endl;
^
/storage/emulated/0/AndroidIDEProjects/MyApplication5588/app/src/main/cpp/native-lib.cpp:7:20: error: use of undeclared identifier 'endl'
cout<<"imyyp"<<endl;
^
5 errors generated.
ninja: build stopped: subcommand failed.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 10s
26 actionable tasks: 3 executed, 23 up-to-date
Alright, I suggest you please speak in English here.
We do not officially support NDK builds. If you're using NDK, you should be able to resolve the errors yourself.