2

Although this may be a programming issue, I figured it would be more appropriate here. My issue is that when I compile my program (using Code::Blocks if it's important), I get a nice (SFML) window and the debug terminal with my application doing what it should do. But, when I double click the file in nautilus (I hope that's correct), nothing happens. I know the file works because I can quite easily open it from the terminal with ./. So, how can I open the executable without using the terminal?

9
  • Is it a console application, which interacts with the user by displaying text in a terminal? Or does your program create a graphical interface? Or something else? Apr 6 '15 at 15:32
  • @EliahKagan It is a SFML application, and also has a terminal open, so I can see what the program does under the bonnet (So basically it creates a graphical interface and displays text in the terminal (but doesn't need to))
    – Orfby
    Apr 6 '15 at 15:36
  • ./ is not actually a command, as it seems you think that. It just means that you tell the shell to look for the filename following it inside the current working directory. You need to explicitly specify the directory to run an executable file to make sure there is no other globally reachable command with the same name (which would be a security issue...).
    – Byte Commander
    Apr 6 '15 at 15:40
  • @ByteCommander This question is about why double-clicking on the executable in Nautilus doesn't work, not about why the name must be preceded by ./ when it's run in the terminal. Double-clicking the executable in Nautilus guarantees that the specific executable is unambiguously selected. Apr 6 '15 at 15:43
  • @EliahKagan I know. I just thought it would be interesting or good to know for the OP. That's why it is a comment and not an answer. - Orfby: Is it marked executable (chmod +x /path/to/file)?
    – Byte Commander
    Apr 6 '15 at 15:46
2

The fix to the problem was reasonably simple, and makes me feel a little dumb. All I had to do was go into the directory that contains the file (with the terminal) then I type sudo ldconfig and, hey presto! It works like a charm. Apparently the problem occurred because the executable couldn't find the libraries, but from double clicking in nautilus, I didn't get any errors, which is why I thought the problem was with nautilus.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.