/srv/irclogs.ubuntu.com/2018/03/30/#ubuntu-cn.txt

andyhuzhill有没有人遇到过编译出来的程序被识别成了 shared object 无法在 nautilus 里面直接双击执行?02:35
iMadperandyhuzhill: file看一下那个文件02:45
andyhuzhilliMadper:  https://imgur.com/a/8AR2s02:50
ubrlandyhuzhill: ⇪  Imgur: The magic of the Internet02:50
andyhuzhill执行是没有问题 就是在nautilus 里面被识别成了共享库  没法双击执行了02:51
iMadperandyhuzhill: 这个就是个shared object... 倒不是nautilus识别错了02:52
andyhuzhill这是一个可执行文件啊02:52
andyhuzhill你没看到我前面的命令么  就是编译了一个简单的 hello world02:52
iMadperandyhuzhill: 我看到了, 我在想是不是g++的问题02:53
iMadper哎呦, 都是shared object...02:54
* iMadper 匿了匿了02:54
andyhuzhillgcc version 5.4.1 20171010 (Ubuntu 5.5.0-1ubuntu2)02:54
iMadperandyhuzhill: 不过你期待的nautilus的行为是啥呢?02:54
iMadperandyhuzhill: 执行helloworld的时候先*自动*起一个console, 然后console里面再执行你的helloworld?02:55
andyhuzhill我这只是演示这个问题  我实际要执行的一个程序是GUI程序02:56
iMadperandyhuzhill: -no-pie02:59
iMadperandyhuzhill: 试试看编译的时候加这个参数02:59
andyhuzhill这是啥参数?  加上之后就变executable 了02:59
iMadperandyhuzhill: 因为你用的gcc, 编译的时候开了 --enable-default-pie03:00
iMadperandyhuzhill: 具体的区别我也不清楚, 毕竟man手册也没写太清楚...03:01
iMadper       -pie03:01
iMadper           Produce a position independent executable on targets that support it.  For predictable results, you must also specify the same set of options used for compilation (-fpie, -fPIE, or model03:01
iMadper           suboptions) when you specify this linker option.03:01
iMadper不好意思, 格式有点乱...03:01
andyhuzhill😅 谢谢啦 iiMadper03:01
iMadperandyhuzhill: 没事儿, 我也是随手一查...03:02
=== chen is now known as Guest49590
u0_a257hi12:31
ubrlu0_a257:点点点.  20:3112:31
=== sixand1 is now known as sixand

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!