I've just compiled a C++ program - which is not a console program, but instead, graphical and using gtkmm.

After building with g++, I can launch it by typing ./program from the terminal. However, if I try to execute it by double-click through the File Manager, it won't run - opens in Text Editor instead. It doesn't even ask me if I want to execute or open in text editor, like it would if this were a bash script for example.

The executable bit is set for this file.

Why is this happening?

  • What command did you use to compile? – DrZoo Apr 13 '18 at 3:44
  • @DrZoo g++ randolfi.cpp -o randolfi with a long list of include paths and libraries (using -I and -l, respectively) from gtkmm and dependencies. – Marc.2377 Apr 13 '18 at 4:05
  • How many files do you have? – DrZoo Apr 13 '18 at 4:11
  • You should do something like g++ helloworld.cpp -o helloworld 'pkg-config gtkmm-X.X --cflags --libs' Where X and X is the version, for example gtkmm-3.0 idk what the current version is. Substitute the ' with a `. I only used them so it wouldn't format it – DrZoo Apr 13 '18 at 4:17
  • @DrZoo Hm, didn't think about piping output from pkg-config directly to the build command. But I was indeed using it, only I was copy-pasting the output. Anyway, my problem is not related to the build process at all. It runs from terminal, and also from a desktop launcher I made. – Marc.2377 Apr 13 '18 at 4:26

Apparently, from reading here (https://unix.stackexchange.com/a/335763/154671), this is simply not possible anymore in GNOME Files, and by extension, Nemo, which is the file browser I'm using.

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.