bijan311
Posts: 4
Joined: Thu Jun 13, 2013 3:09 am

Executable not launching when double clicked

Thu Jun 13, 2013 3:18 am

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.

User avatar
mrpi64
Posts: 931
Joined: Sat Feb 16, 2013 5:13 pm

Re: Executable not launching when double clicked

Thu Jun 13, 2013 10:09 am

Some programs HAVE to be run in the terminal. especially if they have he command 'print' in them!
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.

User avatar
DaveDriesen
Posts: 113
Joined: Sun Mar 31, 2013 8:28 pm
Location: Top of the food chain
Contact: Website

Re: Executable not launching when double clicked

Thu Jun 13, 2013 1:00 pm

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

Return to “General discussion”