所以经过几个小时的努力设置我的 Qt 以便我可以开始我的第一个 Android 应用程序后,我仍然没有运气。我得到了一个非常简单的程序(只是为了正确设置所有设置)来正确构建,但是当我单击播放按钮运行它时,出现了一个我似乎无法解决的错误。这是我按下播放时的完整输出:
22:16:45: Running steps for project Androidtest...
22:16:45: Configuration unchanged, skipping qmake step.
22:16:45: Starting: "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
22:16:48: The process "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
22:16:48: Starting: "mingw32-make" INSTALL_ROOT="D:\\RundownRiot\\Androidtest\\build- Androidtest-Android_for_arm_GCC_4_6_Qt_5_2_0-Debug\\android-build" install
qtcreator_ctrlc_stub: Command line failed: mingw32-make INSTALL_ROOT="D:\\RundownRiot\\Androidtest\\build-Androidtest-Android_for_arm_GCC_4_6_Qt_5_2_0-Debug\\android-build" install
22:16:48: The process "mingw32-make" exited with code -1.
Error while building/deploying project Androidtest (kit: Android for arm (GCC 4.6, Qt 5.2.0))
When executing step 'Copy application data'
22:16:48: Elapsed time: 00:03.
Run Code Online (Sandbox Code Playgroud)
错误在第 6 行。 …
我需要在屏幕上打印一行,然后获取用户输入,但这些printf("blah")语句导致我的代码无法编译。错误消息说'char not expected'但是当我注释掉这些printf()语句时,代码就会编译。
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
printf("Welcome to the shell!\n");
printf("shell:>");
char* inp = (char*)malloc(20); // error at this line
}
Run Code Online (Sandbox Code Playgroud)
我在 MINIX 3.1.0 中使用 cc 编译器