C源文件到Android Arm的交叉编译

C源文件到Android Arm的交叉编译,android,c,android-ndk,cross-compiling,Android,C,Android Ndk,Cross Compiling,我正在尝试使用nim在windows的移动设备上制作一个C语言的交叉编译器。我一直在进行编译,但无法使用USB调试在手机上导出/推送它 下面是我创建的批处理文件。。谁能告诉我怎么了?我只想使用gcc或clang直接编译到我的移动设备 @echo off set PATH=%PATH%;C:/Users/PCTechRinz/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/win

我正在尝试使用nim在windows的移动设备上制作一个C语言的交叉编译器。我一直在进行编译,但无法使用USB调试在手机上导出/推送它 下面是我创建的批处理文件。。谁能告诉我怎么了?我只想使用gcc或clang直接编译到我的移动设备

@echo off

set PATH=%PATH%;C:/Users/PCTechRinz/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin

 nim c --cpu:arm --os:android --compileOnly hello.nim

path = C:/cygwin/bin

g++ -I../sysroot/usr/include -I/path=D:/Installer/nim-0.19.0/lib -pie -o hello.bin hello.cpp stdlib_system.cpp

path = C:/Users/PCTechRinz/AppData/Local/Android/Sdk/platform-tools
 adb root
 adb push hello.bin /data/local/tmp/hello.bin
 adb shell 

cd /data/local/tmp/hello.bin
chmod 755 hello
./hello
pause
下面是我得到的答案

Hint: used config file 'D:\Installer\nim-0.19.0\config\nim.cfg' [Conf]
Hint: system [Processing]
Hint: hello [Processing]
Hint: operation successful (12267 lines compiled; 0.268 sec total; 10.773MiB pea
kmem; Debug Build) [SuccessX]
adb: error: failed to get feature set: no devices/emulators found
error: no devices/emulators found
The system cannot find the path specified.
'chmod' is not recognized as an internal or external command,
operable program or batch file.
'.' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .

我已在手机上启用USB调试

您必须使用Android工具链为Android构建。您的系统的g++目标是Windows,而不是Android

我强烈建议使用ndk build或CMake,但如果出于某种原因需要直接使用Clang,则应该使用