Important: Please read the Qt Code of Conduct -

Running Qt Project as Root

  • Hi all,

    I have an upboard and Ubuntu 16.04 is installed in it. Before using Qt, I simply have created a C++ text file to control pins and I compiled and run it succesfully using terminal with "sudo". We need to run it as admin to reach upboard's pins. Up to now there is no problem.

    When I copied the same code to Qt Creator's environment and tried to run it. But it didnt work because I think I tried to run it as a user. How can I fix this problem?

  • Lifetime Qt Champion

    @Yunus the correct way is to run your program as user.

    Often, these pin devices have a special group. In that case, simply add your user to that group to gain the read/write permissions.

    If not, I'd recommend you to set them up that way.

    Running programs as root can completely destroy your system, even flash memories and such.

  • @aha_1980 Thanks for your advise. I solved the problem giving permissions to user as you said. This link solved my problem. Actually it is completely not about Qt. I posted the topic in wrong area and sorry for that.

Log in to reply