I have a simple source-file 'source.cpp:
#include <iostream>
using namespace std;
int main() {
int ival(0);
cout << "Bitte eine Ganzzahl: ";
cin >> ival;
cout << "Sie gaben die Zahl " << ival << " ein\n";
cout << "Ein Monster mit "
<< "zwei Zeilen\n";
return 0;
}
Now i'm compiling it with:
g++ source.cpp -o out
The result is shown in Thunar as Type 'shared library'. I can run it in Shell with ./out but I can't run it in Thunar by Double-Click.
ldd says:
linux-vdso.so.1 (0x00007fffb55be000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fd5d4387000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007fd5d403b000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fd5d3e24000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007fd5d3a6d000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007fd5d4910000)
When I set the -static Flag I get a Typ 'Program' and it works in Thunar as expected but certainly it's bigger. ldd says 'The Program is not linked dynamically'
A few years ago I compiled this source but I can't remember the compiler-options and i've got a result in Typ 'Program' which was not statically linked. ldd said the same as in the first example.
So, what can i do to get a executable with the type 'Program' which can be executed by double-click in the File-Manager.
(I've certainly set the executable-Flag in all examples)