How to execute a CLion program in gnome terminal?

2019-01-19 20:04发布

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.

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.

1条回答
Summer. ? 凉城
2楼-- · 2019-01-19 20:47

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

  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

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

This will run your program in the gnome terminal.

Hope this helped :)

查看更多
登录 后发表回答