andyhuzhill | 有没有人遇到过编译出来的程序被识别成了 shared object 无法在 nautilus 里面直接双击执行? | 02:35 |
---|---|---|
iMadper | andyhuzhill: file看一下那个文件 | 02:45 |
andyhuzhill | iMadper: https://imgur.com/a/8AR2s | 02:50 |
ubrl | andyhuzhill: ⇪ Imgur: The magic of the Internet | 02:50 |
andyhuzhill | 执行是没有问题 就是在nautilus 里面被识别成了共享库 没法双击执行了 | 02:51 |
iMadper | andyhuzhill: 这个就是个shared object... 倒不是nautilus识别错了 | 02:52 |
andyhuzhill | 这是一个可执行文件啊 | 02:52 |
andyhuzhill | 你没看到我前面的命令么 就是编译了一个简单的 hello world | 02:52 |
iMadper | andyhuzhill: 我看到了, 我在想是不是g++的问题 | 02:53 |
iMadper | 哎呦, 都是shared object... | 02:54 |
* iMadper 匿了匿了 | 02:54 | |
andyhuzhill | gcc version 5.4.1 20171010 (Ubuntu 5.5.0-1ubuntu2) | 02:54 |
iMadper | andyhuzhill: 不过你期待的nautilus的行为是啥呢? | 02:54 |
iMadper | andyhuzhill: 执行helloworld的时候先*自动*起一个console, 然后console里面再执行你的helloworld? | 02:55 |
andyhuzhill | 我这只是演示这个问题 我实际要执行的一个程序是GUI程序 | 02:56 |
iMadper | andyhuzhill: -no-pie | 02:59 |
iMadper | andyhuzhill: 试试看编译的时候加这个参数 | 02:59 |
andyhuzhill | 这是啥参数? 加上之后就变executable 了 | 02:59 |
iMadper | andyhuzhill: 因为你用的gcc, 编译的时候开了 --enable-default-pie | 03:00 |
iMadper | andyhuzhill: 具体的区别我也不清楚, 毕竟man手册也没写太清楚... | 03:01 |
iMadper | -pie | 03: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 model | 03:01 |
iMadper | suboptions) when you specify this linker option. | 03:01 |
iMadper | 不好意思, 格式有点乱... | 03:01 |
andyhuzhill | 😅 谢谢啦 iiMadper | 03:01 |
iMadper | andyhuzhill: 没事儿, 我也是随手一查... | 03:02 |
=== chen is now known as Guest49590 | ||
u0_a257 | hi | 12:31 |
ubrl | u0_a257:点点点. 20:31 | 12:31 |
=== sixand1 is now known as sixand |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!