如何在gnome终端中执行CLion程序? [英] How to execute a CLion program in gnome terminal?

查看:121
本文介绍了如何在gnome终端中执行CLion程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题已经有一个答案此处,但我正在使用CLion 1.2.1版和该帖子中的答案无济于事。是否可以在gnome终端而不是其自己的控制台中运行CLion程序?如果是,怎么办?谢谢。

This question already has an answer here but I am using CLion version 1.2.1 and the answer in that post doesn't help. It is possible to run a CLion program in gnome terminal instead of its own console ? If yes, how ? Thanks.

编辑:我知道可执行文件的存储位置,但想知道是否有可能直接从ide中在终端中运行文件,即通过选择运行

EDIT : I know where the executable file are stored but want to know if it is possible to run the file in terminal directly from the ide i.e. by selecting the run option in ide.

推荐答案

是的,您可以从IDE在gnome终端中执行Clion c / c ++程序。方法如下:

Yes, you can execute a Clion c/c++ program in a gnome terminal from the IDE. Here is how:


  1. 在clion应用程序的右上角,您应该看到项目名称或 Build All。单击该按钮,然后转到编辑配置

  2. 单击加号(左上角),然后单击应用程序

  3. 现在开始到可执行文件:,然后单击选择其他。在那里,您应该转到gnome-terminal的存储位置(我的文件位于ubuntu上的 / usr / bin / gnome-terminal)。

  4. 下一步转到 Program arguments:并输入 -e ./myProjectName (对于较新版本的gnome-terminal -e ,已弃用,请使用-./myProjectName

  5. 转到工作目录:,然后输入在以下位置找到的cmake-build-debug文件夹的位置您的项目文件夹

  1. In the top right of your clion application you should see your project name or "Build All". Click on that and go to "edit configurations"
  2. there click on the plus sign(top left) and then on "Application"
  3. Now go to "Executable:" and click on "select others". There you should go to where your gnome-terminal is stored (mine is at "/usr/bin/gnome-terminal" on ubuntu)
  4. Next go to "Program arguments:" and type -e ./myProjectName (For newer versions of gnome-terminal -e is deprecated, use -- ./myProjectName)
  5. go to "Working Directory:" and type in the location to your cmake-build-debug folder found in your project folder

您现在可以按okay并转到右上角,以选择在步骤2中创建的应用程序的名称

You can now press okay and go to the top right to select the name of your application that you created in step 2

这将在gnome终端中运行您的程序。

This will run your program in the gnome terminal.

希望有帮助:)

这篇关于如何在gnome终端中执行CLion程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆