News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

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

Started by nathanf534, August 05, 2010, 02:00:44 AM

Previous topic - Next topic

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.
(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!]

nathanf534

QuoteHave 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.

stahta01

Quote from: nathanf534 on August 05, 2010, 05:33:34 PM
QuoteHave 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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

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

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

I have solved the problem:

sudo codeblocks ;)