Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Missing CAP_NET_ADMIN permission when executing app through Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Missing CAP_NET_ADMIN permission when executing app through Qt Creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 3.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    agabi
    wrote on 20 Apr 2018, 12:13 last edited by
    #1

    I'm coding a program using the Bluetooth APIs of Qt and when I try to compile it for Linux I get the following error:

    qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type.

    I can fix that by calling the following command and executing the executable after the change:

    sudo setpcap CAP_NET_ADMIN=eip <filename>

    The problem is that I have to do this every time I recompile the code. Is there any way to add this command to the building process for Linux without affecting the builds for Windows and Android?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 20 Apr 2018, 14:37 last edited by
      #2

      Hi
      Well you can run a shell command (or .sh) and make it only apply to linux.
      sorry for not providing links but should be fairly easy to google.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        agabi
        wrote on 23 Apr 2018, 06:44 last edited by
        #3

        Following your advice I just added the QMAKE_POST_LINK entry in the .pro file, but when it calls the command it's stuck waiting for a password for sudo. Is there any way to provide the password?

        1 Reply Last reply
        0

        1/3

        20 Apr 2018, 12:13

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved