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. How to set enviorment variable from . pro file?
Forum Updated to NodeBB v4.3 + New Features

How to set enviorment variable from . pro file?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 447 Views 1 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.
  • Q Offline
    Q Offline
    Q139
    wrote on last edited by Q139
    #1

    How to set enviorment variable LIBGL_ALWAYS_SOFTWARE=1 under .pro file?

    W 1 Reply Last reply
    0
    • Q Q139

      How to set enviorment variable LIBGL_ALWAYS_SOFTWARE=1 under .pro file?

      W Offline
      W Offline
      wrosecrans
      wrote on last edited by
      #2

      You don't. And even if you could, the .pro only controls the build. The LIBGL_ALWAYS_SOFTWARE variable for Mesa is something you can set in the environment when you run a program, not when you build it.

      Q 1 Reply Last reply
      2
      • W wrosecrans

        You don't. And even if you could, the .pro only controls the build. The LIBGL_ALWAYS_SOFTWARE variable for Mesa is something you can set in the environment when you run a program, not when you build it.

        Q Offline
        Q Offline
        Q139
        wrote on last edited by
        #3

        This solves

        int main(int argc, char *argv[])
        {
        #ifdef Q_OS_LINUX  //to run valgrind memcheck under vmware... avoids crash
          qputenv( "LIBGL_ALWAYS_SOFTWARE","1");
        #endif
        
        Christian EhrlicherC 1 Reply Last reply
        0
        • Q Q139

          This solves

          int main(int argc, char *argv[])
          {
          #ifdef Q_OS_LINUX  //to run valgrind memcheck under vmware... avoids crash
            qputenv( "LIBGL_ALWAYS_SOFTWARE","1");
          #endif
          
          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Q139 This solution will prevent hardware opengl on every linux installation. Don't think you really want this... better set the env outside your program.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          Q 1 Reply Last reply
          2
          • Christian EhrlicherC Christian Ehrlicher

            @Q139 This solution will prevent hardware opengl on every linux installation. Don't think you really want this... better set the env outside your program.

            Q Offline
            Q Offline
            Q139
            wrote on last edited by
            #5

            @Christian-Ehrlicher Yes , Is it possible to check for valgrind debug with preprocessor macro?
            Sorry idk how memcheck VM works, perhaps valgrind is initialised at later stage+outside of qt and its not possible with preprocessor...

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Since you know when you run your tool with valgrind you can also set this env var before.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              1

              • Login

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