Author Topic: How to run program from code::blocks with root privileges?  (Read 19655 times)

Offline nathanf534

  • Single posting newcomer
  • *
  • Posts: 3
How to run program from code::blocks with root privileges?
« 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to run program from code::blocks with root privileges?
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline nathanf534

  • Single posting newcomer
  • *
  • Posts: 3
Re: How to run program from code::blocks with root privileges?
« Reply #2 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: How to run program from code::blocks with root privileges?
« Reply #3 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: How to run program from code::blocks with root privileges?
« Reply #4 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.

Talimi

  • Guest
Re: How to run program from code::blocks with root privileges?
« Reply #5 on: April 17, 2013, 05:02:20 pm »
I have solved the problem:

sudo codeblocks ;)
« Last Edit: April 17, 2013, 05:04:18 pm by Talimi »