I am using ubuntu and I am writting a console program that needs to run as root (it is using raw sockets).

I have not found anyway to develop and debug this program without starting qt as root (which I know is bad). I tried making a custom executable script that had a sudo /mypath/myapp in it. But I get the following error when I try to run it with the debugger "/mypath/myapp: not in executable format: File format not recognized."

I also tried using visudo to allow me to run this program as root; but apperantly since this is my space it will not work. This is the line I added in the visudo file.

myusername ALL=NOPASSWD: /mypath/myapp

What is the best way to do this? Or should I run qtcreator as root?