This article is a mirror article of machine translation, please click here to jump to the original article.

View: 276|Reply: 0

[C] ndk is compiled with ndk-build C executable program in win10 using vscode

[Copy link]
Posted on 2025-10-27 13:25:54 | | |
This post was last edited by Summer on 2025-10-27 13:27

1. Install Android studio and configure ndk
2. Create a new empty folder (for example, NDK_Executable_Demo) and create a file with the following structure:
NDK_Executable_Demo
├── jni/               # Store C code and compilation configuration│   
     ├── main.c # main program code│   
     ├── Android.mk #ndk-build compilation rules
     │── Application.mk # Compilation options (target platform, toolchain, etc.)
ThreeWrite code and configuration files
4. jni/Android.mk
5. jni/Application.mk
6. Enter the project root directory
cd D:\xxx\ndk\Myapp
7. Set the NDK path environment variable
$env:NDK_PROJECT_PATH = "D:\xxx\ndk\Myapp"
$env:NDK_PATH = "C:\Users\xxx\AppData\Local\Android\Sdk\ndk\23.0.7599858"
8. Direct implementation of ndk-build.cmd
C:\Users\15617\AppData\Local\Android\Sdk\ndk\23.0.7599858\ndk-build.cmd








Previous:gcc compiles the first ebpf program
Next:Scripting language basic participation materials
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com