无法从Nautilus运行可执行文件 [英] Can't run executables from nautilus

查看:151
本文介绍了无法从Nautilus运行可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(显示的警告)在Ubuntu 18.04上,我编译了一个c ++仅包含stdio.h和使用g++ test.cpp -o test的空主函数的示例 .

(the warning that shows up) On Ubuntu 18.04, I compiled a c++ sample which only included stdio.h and an empty main function using g++ test.cpp -o test .

没有错误弹出,从终端运行它也没有问题.

No errors popped up and I had no issues running it from the terminal.

但是,一旦我继续使用nautilus并尝​​试通过单击test来运行它,就会弹出警告,要求我选择一个程序来打开共享库.

However, once I go on nautilus and try to run it by clicking on test, a warning pops up, asking me to pick a program to open the shared library.

如何确保程序被编译为可执行文件/被文件管理器视为可执行文件?

How do I make sure the program is compiled as an executable/ is seen as an executable by the file manager?

可执行文件上的stat输出(重新编译并将其名称更改为asdff):

stat output on the executable (recompiled and changed the name to asdff):

File: asdff
  Size: 10600       Blocks: 24         IO Block: 4096   regular file
Device: 808h/2056d  Inode: 4200517     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/  miguel)   Gid: ( 1000/  miguel)
Access: 2018-05-18 15:22:58.009993285 +0100
Modify: 2018-05-18 15:22:58.009993285 +0100
Change: 2018-05-18 15:22:58.009993285 +0100
Birth: -

df output on the same executable:


Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sda8      128206036 102694048  18956444  85% /

desktop entry:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=asdff
Exec=./home/miguel/Desktop/asdff
Icon=/home/miguel/Desktop/index.png

推荐答案

我注意到您正在尝试使用桌面文件.很好.

I notice that you were trying to use a desktop file. That is good.

因为Nautilus已被修补以删除执行程序的能力.这是一个安全问题.

将桌面文件放置在应用程序启动器的正确位置,然后以这种方式打开它,而不是使用Nautilus.我相信这个位置是$HOME/.local/share/applications.

Put your desktop file in the right location for the application launcher and open it that way instead of by using Nautilus. This location is $HOME/.local/share/applications, I believe.

这篇关于无法从Nautilus运行可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆