LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem running executable (https://www.linuxquestions.org/questions/linux-newbie-8/problem-running-executable-923925/)

amgilman 01-15-2012 02:58 PM

problem running executable
 
I have compiled a gtkmm program, which will run when I enter ./program_name in the terminal, but will not run when I click/ double-click it. Other programs I have compiled do. I have checked permissions and there seems to be no difference. I suspect I have just missed doing something pretty simple. But what?

Thanks for any help.

celthunder 01-15-2012 03:08 PM

you said you checked this but permission to execute also is it in your path or the one in which you are running it from error in the code or trying to run a 32 bit executable on a 64 bit without 32 bit libraries or a 32 bit system trying to run a 64 bit executable. what happens when you run it from a terminal any error? no output?

MartinStrec 01-15-2012 04:10 PM

You could possibly have wrong relative paths in your code. Try to go into into your home directory 'cd ~' and run your program with full path and name, for example '/usr/local/bin/my_program'.

If it works, you win :-)

When it doesn't, check if SELinux is running and if there is an SELinux denial.

amgilman 01-15-2012 05:54 PM

some clarification
 
I was not clear. The program runs with no error messages when I am in the terminal (and in the same directory as the program). The problem is that I get no response (including no error messages) when I click (or double-click) the icon. Other programs I have compiled function as expected, so I do not think this is a problem between systems. I do not think that I have done anything differently from I have done in other situations, but for some reason this program will not run from clicking the icon (but will run from the terminal command). Perhaps it is just bad karma, but I am assuming (perhaps naively) that I have just neglected some basic step.

Thanks for the responses.

lisle2011 01-15-2012 06:30 PM

Executable issues
 
Try chmod 0764 your_program.
Some freshly compiled programs will run from the directory they are compiled in but not from anywhere else. Perhaps you need to move the program so it is at least in your /home path and perhaps the icon's path will subsequently need to be changed, otherwise there is no reason unless a library to run in the GUI is missing or some other such thing.

celthunder 01-15-2012 08:54 PM

Are you sure the program isn't running and then just killing itself? No output for most commands means it ran and exited without error. Perhaps it's an error in the program itself.

larrym82 01-15-2012 10:09 PM

My take...
 
Quote:

Originally Posted by amgilman (Post 4575314)
I have compiled a gtkmm program, which will run when I enter ./program_name in the terminal, but will not run when I click/ double-click it. Other programs I have compiled do. I have checked permissions and there seems to be no difference. I suspect I have just missed doing something pretty simple. But what?

Thanks for any help.

A couple of things come to mind: First, I assume you are clicking or dbl clicking on an icon (not from within the terminal). If that's the case, your icon properties likely do not have the path/command entered correctly. Right click the icon, go to properties and you should be able to fix your problem from there.

amgilman 01-16-2012 06:47 AM

Thank you
 
Thank you for these suggestions. Unfortunately, none seem to address whatever the issue is. When the program runs (which it does when called in the terminal) it creates a window which persists until I close it, so I do not think the program is running and closing itself. Also, the properties all seem to be in order. I have recompiled it, thinking there may be something in that, but recompiling did not help.

As I mentioned in my first post, other programs I have compile run when I click on their icon, so I am very much stumped.

This is obviously not a major issue, but any thoughts would be welcome.

Thanks again.

larrym82 01-16-2012 12:03 PM

Quote:

Originally Posted by amgilman (Post 4575788)
Thank you for these suggestions. Unfortunately, none seem to address whatever the issue is. When the program runs (which it does when called in the terminal) it creates a window which persists until I close it, so I do not think the program is running and closing itself. Also, the properties all seem to be in order. I have recompiled it, thinking there may be something in that, but recompiling did not help.

As I mentioned in my first post, other programs I have compile run when I click on their icon, so I am very much stumped.

This is obviously not a major issue, but any thoughts would be welcome.

Thanks again.

When you open in the Terminal, are you logged in as root? (You should NOT be, but if you are that means your permissions aren't correct.)

Does the Terminal window stay open along with the program? You might look in the home directory of the program for a configuration file of some kind (it is likely hidden as a .filename file which can be viewed with ls -a from a terminal), it might be that your config file shows a different PATH or version variable. This happened to me when I installed BlueJ, but with a bit of editing, I now have all working according to my needs.

amgilman 01-17-2012 06:23 AM

Thank for these responses. I have not exactly solved the problem, but I believe that I have identified (or at least narrowed) the suspects: it seems to be with the signal handling routine in the program itself. When I remove that section of the program, I can double click the icon and the program will run. I don't really understand what is going on (this applies generally), but the signal emitted from the mouse-click and the signal within the program seem to be in conflict of some sort. Further thoughts would be helpful, but essentially I am going to solve the problem by removing it(the signal handling part).

Thanks again.

MartinStrec 01-17-2012 06:45 AM

Looks fine, very interesting problem.

amgilman 01-17-2012 10:03 AM

Actually, this seems to be related to the computer's system. The machine which experiences problems is running PClinuxOS. At work I run Mandriva and there things function as I expected (hoped).

larrym82 01-17-2012 11:49 AM

Quote:

Originally Posted by amgilman (Post 4576951)
Actually, this seems to be related to the computer's system. The machine which experiences problems is running PClinuxOS. At work I run Mandriva and there things function as I expected (hoped).

That is interesting. I run PClinuxOS with KDE desktop, and have noticed that there are elements of Mandriva in it while scouting around in the terminal. Are you operating the same desktop on both machines? Keep in mind that the kernel is the only truly Linux part of your system and that it acts as an intermediary between the software you're using and the hardware. It might be the case that compiling a customized kernel for your specific hardware would obviate this issue, but I for one do not possess those skills.

amgilman 01-18-2012 06:39 AM

The first (non-obedient) machine is running PClinuxOS with KDE desktop. The other machine (Mandriva) has, I think, a gnome (or gnome-ish) desktop.

Thank you for the suggestion about the kernel. I am really pretty new at this, so that is an option for when I know (much) more.

larrym82 01-18-2012 06:56 AM

Quote:

Originally Posted by amgilman (Post 4577766)
The first (non-obedient) machine is running PClinuxOS with KDE desktop. The other machine (Mandriva) has, I think, a gnome (or gnome-ish) desktop.

Thank you for the suggestion about the kernel. I am really pretty new at this, so that is an option for when I know (much) more.

You're welcome. In my experience KDE is not compatible with GNOME and possibly gtk software. It may be PCLOS though, because I know they are pretty insistent on getting software ONLY from their repositories. Guess it's time to sign off. Best
Larry


All times are GMT -5. The time now is 02:58 AM.