Page 1 of 1

Executable not launching when double clicked

Posted: Thu Jun 13, 2013 3:18 am
by bijan311
I got my first raspberry pi earlier today and created a simple hello world program for it in C++. I went to run the program and when I double clicked the executable, a window popped up asking if I wanted to execute it or execute it in the terminal. When I selected both of the options nothing happened, but when I open the terminal and type in the path to the executable it works just fine. Does anyone know how to fix this?

Thank You.

Re: Executable not launching when double clicked

Posted: Thu Jun 13, 2013 10:09 am
by mrpi64
Some programs HAVE to be run in the terminal. especially if they have he command 'print' in them!

Re: Executable not launching when double clicked

Posted: Thu Jun 13, 2013 1:00 pm
by DaveDriesen
Yes, you will need to create an application window if you need a GUI. The easiest way is to use a GUI builder such as QT or Glade.

Your windowed application would then use a message loop to detect when the user wishes to exit, instead of terminating immediately the way it's doing now.. Come to think of it, you can also just use a loop in your console application to keep it from exiting, but that's probably not your goal.

For graphical apps you can eventually roll your own GUI, but it is quite advanced, unless you only want to print text onscreen in which case you can use freetype.

Dave Driesen
Linux dev and oldskool elite