如何在 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 中在终端中运行该文件,即通过在 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:
- 在您的 clion 应用程序的右上角,您应该会看到您的项目名称或全部构建".单击它并转到编辑配置"
- 点击加号(左上角),然后点击应用程序"
- 现在转到可执行文件:"并单击选择其他人".在那里你应该去你的 gnome-terminal 的存储位置(我的在 ubuntu 上的/usr/bin/gnome-terminal")
- 接下来转到程序参数:"并键入
-e ./myProjectName
(对于较新版本的 gnome-terminal-e
已弃用,请使用-- ./myProjectName
) 转到工作目录:"并输入您在项目文件夹中找到的 cmake-build-debug 文件夹的位置
- 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"
- there click on the plus sign(top left) and then on "Application"
- 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)
- Next go to "Program arguments:" and type
-e ./myProjectName
(For newer versions of gnome-terminal-e
is deprecated, use-- ./myProjectName
) go to "Working Directory:" and type in the location to your cmake-build-debug folder found in your project folder
您现在可以按确定并转到右上角,选择您在第 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.
希望这有帮助:)
相关文章