Qt Creator中运行纯C项目 [英] Run Plain C Project in Qt Creator
问题描述
我创建使用Qt Creator中一个普通的C项目
文件 - >新建文件或项目 - >非Qt的项目 - >纯C项目
I created a plain c project in qt creator using File->New file or Project->Non Qt Projects->Plain C Project
的main.c
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
test.pro
test.pro
TEMPLATE = app
CONFIG += console
CONFIG -= qt
SOURCES += main.c
我建立用Ctrl + B这是成功的项目。但我不能够运行使用Ctrl + R项目。
我前面用来运行下面的命令来编译和运行C程序
I build the project using Ctrl+B which was successful. But I am not able to run the project with Ctrl+R. I earlier used to run the following command to compile and run c program
gcc main.c
./a.out
但现在我没能获得如何在Qt Creator中运行C程序。
我是新来的Qt Creator的。请帮助
But Now I am not able to get how to run c program in qt creator. I am new to Qt Creator. Please Help
推荐答案
你有没有正确设置你的项目的运行设置?
Have you set the run settings of your project correctly ?
请确保将它们设置这样的 https://开头QT -project.org/doc/qtcreator-3.0/creator-run-settings.html
Make sure to set them like this https://qt-project.org/doc/qtcreator-3.0/creator-run-settings.html
的编辑:更新的链接近期QtCreator版本的
好像工作目录或可执行文件的路径丢失。
有没有给像任何输出无法执行./a.out:没有这样的文件或目录?
Seems like the working directory or executable path are missing. Is there any output given like "could not execute ./a.out : No such file or directory" ?
这篇关于Qt Creator中运行纯C项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!