Android NDK Environment built under Windows XP

Source: Internet
Author: User

Build the Android NDK environment the Windows XP environment1 Some Downloads

NDK r7:http://developer.android.com/sdk/ndk/index.html
cygwin:http://www.cygwin.com/(1.7.11-1)
notepad++:http://notepad-plus-plus.org/download/v5.9.8.html

2 Cygwin installation

perform the downloaded setup.exe. Click Next
Select the installation method. Select Online installation. Suppose there is an off-the-shelf package. Option to install offline
Select the installation folder (Cygwin finally install folder)
Setting the local package staging path (download file storage folder)
Setting the network connection mode: Default direct connection
Select Download website. It's faster than http://mirrors.163.com.
Select the installation item.

By default, just select Devel (click Devel in the list, change the default to install), and the others are the defaults.
Note: binutils, gcc, Gcc-mingw, GDB, make and so on must be installed. See Refs-5
long wait until download is complete
Note: After downloading the package can be backed up, so that in the future can be directly offline installation, Fast Oh!


adds environment variables (System Properties, environment variables->path) to the system, such as my c:/cygwin/bin

3 Cygwin environmental validation

executes Cygwin once (Cygwin.bat). To create some user environment files
Detection
Version number of Cygwin: Cygcheck-c Cygwin
GCC version number: gcc--version
Version number of g++: g++--version
Make's version number: Make--version
GDB version number: GDB--version
The results are for example:

4 Configuring the NDK Path

Extract the downloaded NDK to a folder
Zai Cygwin home\< your username>\.bash_profile file last added: (Available notepad++ or ultraedit open)
ndk=/cygdrive/< your drive symbol >/<android NDK folder > Export NDK,
As my NDK=/CYGDRIVE/C/ANDROID/ANDROID-NDK-R7 export NDK
Note: The name "NDK" is a random one, and it is often used for a long time.
Verification
Restart Cygwin, enter: CD $NDK
can enter the NDK corresponding folder description settings OK.

5 compiling project build. So file

Way One:
Compile under the Cygwin command line, as seen in the compile step. Three-step


into Android Project working folder: CD $NDK
into the Samples\hello-jni folder, the full path is C:\Android\android-ndk-r7\samples\hello-jni
Execution: $NDK/ndk-build.
Note: the command $NDK and/ndk-build are connected together with no spaces in between. The actual use is to enter the complete $ndk/ndk-build, do not just play ndk-build


Way two:
in the. bash_profile file mentioned in step 4. Add to Jni=/cygdrive/jni folder
As I can for Jni=/cygdrive/c/android/android-ndk-r7/samples/hello-jni.
CD $NDK
CD $jni

Two files are generated after normal compilation. For example, generate the appropriate. So file under the Project Libs/armeabi folder.

6 integration of C + + development environment in Eclipse (alternative)

Official website: http://www.eclipse.org/cdt/downloads.php
method One : Find the online installation address of the CDT plugin that matches your Eclipse version number on the official website and install it in Eclipse's install New software
mode two : Download the CDT installation package that matches your Eclipse version number on the official website, and after extracting the plugins and feagures copy, overwrite it with the Eclipse folder to

7 compiler for C + + configuration ...

8 Common errors and workarounds

problem: Android ndk:host ' awk ' tool is outdated. For example, with the errors that I have seen, I have encountered problems

FIX: Delete awk execution file
References: http://sunting-bcwl.iteye.com/blog/1278574
http://maidini.blog.163.com/blog/static/3776270420111195059911/
mistake will Cygwin Terminal as Cygwin.bat, this problem bothered me for nearly one hours Ah!


Other online issues http://bbs.chinavideo.org/viewthread.php?tid=10821&extra=page%3D2

Ubuntu11.10 environment (pending update ...)


Refs

1 http://blog.csdn.net/javatiger427/article/details/6115693
2 http://maidini.blog.163.com/blog/static/3776270420111194440211/
3 http://www.cnblogs.com/luxiaofeng54/archive/2011/08/13/2136982.html
4 http://www.metsky.com/archives/525.html
5 http://www.cnblogs.com/playing/archive/2011/07/14/2106727.html

Android NDK Environment built under Windows XP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.