11

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.

Community
  • 1
  • 1
newuser
  • 129
  • 1
  • 1
  • 8
  • 1
    Press compile, see where the executable is located, `cd` into directory and execute it? That's how I would've done it. – Leandros Apr 17 '16 at 10:29
  • Possible duplicate of [Where does CLion store executable files?](http://stackoverflow.com/questions/25836027/where-does-clion-store-executable-files) – sitic Apr 19 '16 at 22:58
  • 2
    @Leandros, what the purpose of an IDE, if I need to start the program manually in a terminal. CLion should have an option to start a program in an external console. Especially for programs using ncurses. – Luke Skywalker Nov 06 '16 at 20:08
  • did you solve it? I found this option in codeblocks in tab _Terminal to launch console program_ **gnome-terminal --disable-factory -t $TITLE -x** – Mour_Ka Jan 31 '17 at 09:50

1 Answers1

11

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 :)

GlacierSG
  • 469
  • 4
  • 14