I'm using Ubunru 15.04
GCC : 4.9.2
I usually use this command to compile my cpp files :
g++ /path/file.cpp -o /path/output
and it's cool ! so I made this into a shortcut with
.desktop
file format and make it executable and it works just fine !!
now I need to make a single shortcut to compile the cpp file and run the output
I simply tried :
g++ file.cpp -o output && /output
but this didn't work and giving Permission Denied when I try to run the .desktop file in terminal
ebram96@ebram96-jj:~$ '/path/shortcut.desktop'
/path/shortcut.desktop: line 1: [Desktop: command not found
/path/shortcut.desktop: line 2: run: command not found
/path/shortcut.desktop: line 3: /path/file.cpp: Permission denied
here is my .desktop file :
[Desktop Entry]
Name=compile&run
Exec=g++ /path/code.cpp -o /path/output && /path/output
Terminal=true
Type=Application
I simply tried :
g++ file.cpp -o output && ./output
I tried editing /etc/sudoers file adding these lines it also didn't work :
my_username ALL = NOPASSWD: /path/shortcut.desktop
my_username ALL = NOPASSWD: /path/
my_username ALL = NOPASSWD: /same_shortcut_path/output
Exec=g++ /path/to/your/foo.cpp -o /path/to/your/output && /path/to/your/output