User forums > Help

How to run program from code::blocks with root privileges?

(1/2) > >>

nathanf534:
How do I run a program from code::blocks with root privileges?

I'm using Ubuntu 10.4

oBFusCATed:
Have you tried "sudo yourprogram"?
If this doesn't work you can one of the graphical sudos.
But probably debugging with "debug->start" won't be possible, you'll have to attach to the process.

nathanf534:

--- Quote ---Have you tried "sudo yourprogram"?
--- End quote ---
Yes, I am doing that now, I was just hoping there was a setting in code::blocks so I don't have to go to the terminal every time I want to test the program.

stahta01:

--- Quote from: nathanf534 on August 05, 2010, 05:33:34 pm ---
--- Quote ---Have you tried "sudo yourprogram"?
--- End quote ---
Yes, I am doing that now, I was just hoping there was a setting in code::blocks so I don't have to go to the terminal every time I want to test the program.

--- End quote ---

There is; it works sightly differently between Windows and Linux; so, it might not do what you want.
I am on windows; so, I am not sure what Linux shows.
Try "Project" -> "set Program Arguments"

Tim S.

ptDev:

--- Quote from: nathanf534 on August 05, 2010, 02:00:44 am ---How do I run a program from code::blocks with root privileges?

I'm using Ubuntu 10.4

--- End quote ---

If you're using Gnome (the default desktop), use gksudo <your program>. It will ask the password and run the program as root, but using a gnome prompt window instead of the shell.

Navigation

[0] Message Index

[#] Next page

Go to full version