Code::Blocks Forums

User forums => Help => Topic started by: nathanf534 on August 05, 2010, 02:00:44 am

Title: How to run program from code::blocks with root privileges?
Post by: 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
Title: Re: How to run program from code::blocks with root privileges?
Post by: oBFusCATed on August 05, 2010, 09:29:23 am
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.
Title: Re: How to run program from code::blocks with root privileges?
Post by: nathanf534 on August 05, 2010, 05:33:34 pm
Quote
Have you tried "sudo yourprogram"?
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.
Title: Re: How to run program from code::blocks with root privileges?
Post by: stahta01 on August 05, 2010, 06:45:10 pm
Quote
Have you tried "sudo yourprogram"?
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.

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.
Title: Re: How to run program from code::blocks with root privileges?
Post by: ptDev on August 06, 2010, 08:24:58 am
How do I run a program from code::blocks with root privileges?

I'm using Ubuntu 10.4

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.
Title: Re: How to run program from code::blocks with root privileges?
Post by: Talimi on April 17, 2013, 05:02:20 pm
I have solved the problem:

sudo codeblocks ;)