Bloque de código no se ejecutará mi programa, me sale sh: ruta de archivo: Permiso denegado Ubuntu 10.04

StackOverflow https://stackoverflow.com/questions/3788505

Pregunta

Así que estoy tratando de conseguir este programa a plazo, pero los bloques de código me lanza este error cuando intento ejecutarlo.

sh::. Permiso denegado

Estoy casi 100% novato, por lo que los enlaces de averiguar cómo solucionarlo o material educativo sobre el tema sería grande para el aprendizaje que pienso, pero cualquier idea sería útil realmente. :)

¿Fue útil?

Solución

Correctly set up a project in code::blocks. (I will walk you through setting up a simple Console Application)

Frist Select "Console Application"

Then Select C or C++

Then Set your project Title and location

And then select the default compiler (GNU GCC Compiler)

Finally some template "hello world" code should appear, press F9 to compile and run.

For other future examples Just check out the Code::Blocks User manual: http://www.codeblocks.org/user-manual or Google

note This came from our conversation where we discovered he misc-onfigured Code::Blocks

Otros consejos

Not sure what OS you're using.. but if it's Ubuntu, I use CodeBlocks on Ubuntu and have had this exact problem MANY times.

The "user" option (in etc/fstab) by default sets up "noexec".

so in /etc/fstab just add ,exec after user. i.e. mine looks like this: /dev/sda6 /media/DATA vfat uid=kenny,gid=kenny,users,user,exec 0 0 Though, the spacingis a bit off... but you get the idea.

This may be a bit tough if you're new to linux. So google about the fstab file. Also, make back up before you try to edit anything (sudo cp /etc/fstab /etc/fstab.backup)

sudo gedit /etc/fstab will open up the fstab file so you can see if the filesystem has exec in it

I just clicked the Abort button adjacent to Build and Run and it gave this error

permission denied

I solved the problem by going to Build > Select Target > Release

it may be because the directory/file is not given execute permission you can fix this by using command on terminal sudo chmod +x [path to your directory or path to individual file]

like in my case all my codes are in /home/nikhil/code so sudo chmod +x /home/nikhil/code

it worked in my case

If it's an imported project (or you just copied/downloaded it to your hard drive) try rebuilding it.

Start Codeblocks IDE => Open the project => Right click => Rebuild => Click 'Yes' on the prompt.

This happens every time I copy my old projects from USB to HDD after clean system install or system update.

I hope this is the case with you as well, because I tried a lot of 'permission related' solutions first time I encountered this and they didn't get me far.

Best of luck and I'm looking forward to your feedback.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top