Every time I try to execute a program, no matter what program, I get this message:
bash: ./filename.cpp: Permission denied
When I compile I have no problems, it works fine. But when I want to execute I get this message.
Does it have anything to do with permissions? Because I'm having a lot of problems with this, too. I can't access my shared folders, unless I use
sudo nautilus
Please see my other question.
chmod u+x program_namewhere program_name is the programs name. And then execute the program. – Steam gamer Dec 21 '15 at 12:21g++ -o yourprog main.cthen./yourprog- do not add the-cflag to theg++command unless you want it to produce an object code file instead of a full executable. See What is a command to compile and run C++ programs? – steeldriver Dec 21 '15 at 12:35main.cppfile does not actually contain amainfunction: see Linker returns “relocation has an invalid symbol at symbol index…” – steeldriver Dec 21 '15 at 12:53