Dear all,
I see the compiler has been updated so I try again. However, I still cannot use it in NDK r9.
OS: Windows 8 64 bit, Android NDK r9 for 64 bits
C:\android-ndk\toolchains\arm-linux-androideabi-snapdragonclang3.3.1
My Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := MyApp
LOCAL_SRC_FILES := test.cpp
include $(BUILD_SHARED_LIBRARY)
My Application.mk
NDK_TOOLCHAIN_VERSION := snapdragonclang3.3.1
APP_ABI := armeabi-v7a
APP_PLATFORM := android-10
test.cpp: bool test() { return true; }
Input:
call C:\android-ndk\ndk-build NDK_DEBUG=0
Output:
"Compile++ thumb : MyApp <= test.cpp
process_begin: CreateProcess(NULL, bash
C:\android-ndk\toolchains\arm-linux-androideabi-snapdragonclang3.3.1\snapdragon-clang++
-MMD
-MP
-MF .
/obj/local/armeabi-v7a/objs/MyApp/test.o.d
-gcc-toolchain
C:/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64
-fpic
-ffunction-sections
-funwind-tables
-fstack-protector
-no-canonical-prefixes
-target
armv7-none-linux-androideabi
-march=armv7-a
-mfloat-abi=softfp
-fno-exceptions
-fno-rtti
-mthumb
-DNDEBUG
-fomit-frame-pointer
-fno-strict-aliasing
-IC:/android-ndk/sources/cxx-stl/system/include
-Ijni
-DANDROID
-Wa,
--noexecstack
-Wformat
-Werror=format-security
-IC:/android-ndk/platforms/android-9/arch-arm/usr/include
-c jni/test.cpp
-o ./obj/local/armeabi-v7a/objs/MyApp/test.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [obj/local/armeabi-v7a/objs/MyApp/test.o] Error 2
I really want to have some advices...Could anyone help me?
Thank you very much!!!
Cathy
Cathy,
Please set the variable PLATFORM=windows-x86_64 on the command line invocation.
This enables the Snapdragon wrapper scripts to use the correct GCC 4.7 toolchain for the platform.
I was able to build your test case by setting this variable:
$ PLATFORM=windows-x86_64 /cygdrive/c/android-ndk-r9/ndk-build NDK_DEBUG=0
Cygwin : Generating dependency file converter script
Compile++ thumb : MyApp <= test.cpp
clang++.exe: warning: argument unused during compilation: '-march=armv7-a'
StaticLibrary : libstdc++.a
SharedLibrary : libMyApp.so
Install : libMyApp.so => libs/armeabi-v7a/libMyApp.so
Note: The Android.mk, Application.mk and test.cpp files are under jni directory.
Thanks,
Mandeep
Thanks for your reply,
I add it but I still get the same error messges....
How to make messages more clear?... I try it again and again...
How to use LLVM...Should I need Cygwin?
BTW, I directly try to compile sample code "hello-jni" under the NDK r9 folder, but it still cannot work.
P.S. I add Application.mk only.
BTW, if I set NDK_TOOLCHAIN_VERSION := clang3.3
every things work very well....
I use another computer (Windows XP 32 bits) to try again,
and download 32 bits SDK and NDK r9, try to compile the sample code, it shows the same error message...
Sorry to hear that you are having trouble using Snapdragon LLVM.
Can you kindly check if the "Microsoft Visual C++ 2010 Redistributable package for x86" is installed on your windows system. This package installs msvcp100.dll which is required for Snapdragon LLVM on Windows to work correctly. The redistributable package can be found at
http://www.microsoft.com/enus/ download/details.aspx?displaylang=en&id=5555
The above URL is also listed in the README.install PDF file available in Qdevnet. Kindly let us know if installing the above package fixes the issue.
Thank you for your patience
--Raja
Yes, I try again, I also download .Net Framework.
However, as I mentioned before, because I have installed VC2010 Express & VC2012 Express, they just show "A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on the machine."
P.S. I have Visual C++ 2010 Redistributable x86 & x64
They aren't helpful........
Do I need to use Cygwin or Apache Ant?
Could you try it on your computer for NDK r9 (64bits) and this compiler (3.3.1) again? And teach me your steps? Please...Thank you...
What's your PATH environment variable?
Cathy,
Please use Cygwin (and not Apache Ant). This requirement is enforced by the Android NDK (and not by LLVM itself).
Here are the steps I follow:
1. Download android-ndk-r9-windows-x86_64 (from http://dl.google.com/android/ndk/android-ndk-r9-windows-x86_64.zip) under C:\
2. Extract Snapdragon LLVM 3.3.1 under C:\android-ndk-r9-windows-x86_64\toolchains
3. I have installed CYGWIN_NT-6.1-WOW64
4. I then placed your test.cpp, Android.mk and Application.mk under C:\android-ndk-r9-windows-x86_64\samples\test\jni
5. Under Cygwin, cd /cygdrive/c/android-ndk-r9-windows-x86_64\samples\test
6. Invoke compilation as:
PLATFORM=windows-x86_64 NDK_TOOLCHAIN_VERSION=snapdragonclang3.3.1 /cygdrive/c/android-ndk-r9-windows-x86_64/ndk-build NDK_DEBUG=1
Output:
Compile++ thumb : MyApp <= test.cpp
7. There is nothing special in my PATH variable.
Hope this helps.
To use this compiler, do I need to copy any file to my following folders?
C:\android-ndk\platforms\android-14\arch-arm\usr\include
C:\android-ndk\platforms\android-14\arch-arm\usr\lib
android-14 is the version I use, it can be android-18 or others.
No, you do not need to copy any file to those folders
Thank you so much!!! Now it can compile my app.
But I do not know the reason. I just use Cygwin Terminal replace Windows Command Processor (%windir%\system32\cmd.exe).
Anyway, I will use Cygwin.
P.S. Can I directly ignore the warning "warning: argument unused during compilation: '-march=armv7-a'"?
Because I build my classmate's code and get different result. I think she may use undefined behaviors in C/C++ code. I am checking now..
Thanks a lot!!!
Oh, so sad....
If I use Clang3.3, it can get the same result with GCC.
But Snapdragon LLVM Compiler get the different result...
Is there any possible reason?
If I use this compiler, -O3 -Ofast will cause wrong result, lower level: -O1, -O2 seem to be OK.
I enable the following warning and solve all: