简体   繁体   English

安装cmake后从QtCreator运行项目

[英]Running projects from QtCreator after cmake install

have some real trouble with QtCreator on ubuntu 18 and was wondering if anyone could give me any help. 在ubuntu 18上使用QtCreator遇到了一些麻烦,并且想知道是否有人可以给我任何帮助。 This morning I installed cmake for another project I was working on, now when I try to run a project in qtcreator it is trying to deploy it via FTP, even though it is a Qt c++ project. 今天早上,我为正在处理的另一个项目安装了cmake,现在当我尝试在qtcreator中运行一个项目时,即使它是Qt c ++项目,它仍试图通过FTP进行部署。 I dont know if this is anything to do with cmake, but this worked last night before I installed it. 我不知道这与cmake有什么关系,但这在我安装它之前的昨晚起作用。 My question is, can anybody explain to me how to run a project from QtCreator, on the local system( Terminal or otherwise, doesnt matter ) without any deployment issues. 我的问题是,任何人都可以向我解释如何从QtCreator在本地系统(终端或其他方面,无所谓)上运行项目而没有任何部署问题。 Im sorry if this is a stupid question, but I am extremely grateful for any hep 对不起,如果这是一个愚蠢的问题,但我非常感谢您的帮助

In a console, you can just cd into the project directory (where the .pro file resides) and execute "qmake" and then "make". 在控制台中,您可以仅CD进入项目目录(.pro文件所在的目录),然后执行“ qmake”,然后执行“ make”。 That should compile your executable which you can then run using "./[executable filename]" or "/[path]/[executable filename]". 那应该编译您的可执行文件,然后您可以使用“ ./ [可执行文件名]”或“ / [路径] / [可执行文件名]”来运行。 Also, on the console you might see where this FTP transfer comes from. 此外,在控制台上,您可能会看到此FTP传输的来源。 Also, in QtCreator you can set the build system and change that from cmake to something else to see if its a cmake problem. 此外,在QtCreator中,您可以设置构建系统并将其从cmake更改为其他内容,以查看是否存在cmake问题。

So, not sure how this issue came up, but I have found a workaround after much trial and error. 因此,不确定如何解决此问题,但是经过反复尝试,我发现了一种解决方法。 Open a project, In the left tab click Projects and under build and run select Run. 打开一个项目,在左侧选项卡中单击“项目”,然后在“生成并运行”下选择“运行”。 In this menu deploy steps have already been added when i create a project, so these need to be deleted. 在此菜单中,当我创建项目时已经添加了部署步骤,因此需要删除这些步骤。 Now in the Run section on the same screen Click add -> Custom executable and select the file that has already been built for the project in question. 现在,在同一屏幕上的“运行”部分中,单击添加->自定义可执行文件,然后选择已为相关项目构建的文件。 In my case this solves the above problem, but does not explain why QtCreator is trying to deploy C++ projects via FTP. 就我而言,这解决了上述问题,但没有解释为什么QtCreator试图通过FTP部署C ++项目。 If anyone out there is struggling with this issue feel free to post a question here and I will assist as much as possible! 如果有任何人在这个问题上苦苦挣扎,请随时在此处发布问题,我会尽可能提供帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM