【发布时间】:2018-10-17 10:29:25
【问题描述】:
我正在尝试使用 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 c android-ndk cross-compiling