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. Run environment in Qt Creator
Forum Update on Monday, May 27th 2025

Run environment in Qt Creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
26 Posts 5 Posters 4.9k Views
  • 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 aha_1980
    16 Sept 2019, 07:46

    @gibbogle

    In Creator 4.10 it's here:

    0_1568619918779_f46311d7-c0e4-47c3-a326-e0f6356d647a-image.png

    It may look a bit different in 4.9, but the Projects context menu on a file contains that entry.

    Regards

    G Offline
    G Offline
    gibbogle
    wrote on 16 Sept 2019, 10:16 last edited by
    #12

    @aha_1980
    When I open a terminal with any one of the three environment options (Build, System, Run) and execute the program at the command line, it doesn't crash. It seems that for the purposes of running my program the three environments are all equivalent. When it is invoked by one of the green arrows in Creator, it crashes.

    A 1 Reply Last reply 16 Sept 2019, 10:46
    0
    • G gibbogle
      16 Sept 2019, 10:16

      @aha_1980
      When I open a terminal with any one of the three environment options (Build, System, Run) and execute the program at the command line, it doesn't crash. It seems that for the purposes of running my program the three environments are all equivalent. When it is invoked by one of the green arrows in Creator, it crashes.

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 16 Sept 2019, 10:46 last edited by
      #13

      @gibbogle said in Run environment in Qt Creator:

      @aha_1980
      When I open a terminal with any one of the three environment options (Build, System, Run) and execute the program at the command line, it doesn't crash. It seems that for the purposes of running my program the three environments are all equivalent. When it is invoked by one of the green arrows in Creator, it crashes.

      Ok, so we still have no solution for your problem, but we know that the environment is unguilty.

      Does that also happen if you create a "Hello World" example with the wizards?

      And coming back to @JonB's strace: you can create a custom run configuration (Project > Build & Run > Run > Run configuration > Add > Custom) and see which output you get, hopefully that gives some insight?

      Regards

      Qt has to stay free or it will die.

      G 1 Reply Last reply 16 Sept 2019, 23:16
      2
      • A aha_1980
        16 Sept 2019, 10:46

        @gibbogle said in Run environment in Qt Creator:

        @aha_1980
        When I open a terminal with any one of the three environment options (Build, System, Run) and execute the program at the command line, it doesn't crash. It seems that for the purposes of running my program the three environments are all equivalent. When it is invoked by one of the green arrows in Creator, it crashes.

        Ok, so we still have no solution for your problem, but we know that the environment is unguilty.

        Does that also happen if you create a "Hello World" example with the wizards?

        And coming back to @JonB's strace: you can create a custom run configuration (Project > Build & Run > Run > Run configuration > Add > Custom) and see which output you get, hopefully that gives some insight?

        Regards

        G Offline
        G Offline
        gibbogle
        wrote on 16 Sept 2019, 23:16 last edited by
        #14

        @aha_1980
        I am able to build and run the examples, and also an application to test Qt3d functionality that I made from a couple of the examples.

        I set up a custom run configuration (thanks for explaining that), but when I run it, a couple of 'Permission denied' errors are generated, one apparently from execve, the other from fstat (unfortunately it does not seem to be possible to copy-and-paste from the terminal), so strace "exited with 1".

        A J 2 Replies Last reply 17 Sept 2019, 03:46
        0
        • G gibbogle
          16 Sept 2019, 23:16

          @aha_1980
          I am able to build and run the examples, and also an application to test Qt3d functionality that I made from a couple of the examples.

          I set up a custom run configuration (thanks for explaining that), but when I run it, a couple of 'Permission denied' errors are generated, one apparently from execve, the other from fstat (unfortunately it does not seem to be possible to copy-and-paste from the terminal), so strace "exited with 1".

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 17 Sept 2019, 03:46 last edited by
          #15

          @gibbogle ok, so if the examples work, it must be your project.

          Have you already wiped the build folder and .pro.user and rebuild your project?

          Are you linking external libs?

          Regards

          Qt has to stay free or it will die.

          G 1 Reply Last reply 18 Sept 2019, 00:46
          0
          • G gibbogle
            16 Sept 2019, 23:16

            @aha_1980
            I am able to build and run the examples, and also an application to test Qt3d functionality that I made from a couple of the examples.

            I set up a custom run configuration (thanks for explaining that), but when I run it, a couple of 'Permission denied' errors are generated, one apparently from execve, the other from fstat (unfortunately it does not seem to be possible to copy-and-paste from the terminal), so strace "exited with 1".

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 17 Sept 2019, 04:19 last edited by
            #16

            @gibbogle said in Run environment in Qt Creator:

            it does not seem to be possible to copy-and-paste from the terminal

            It is possible: mark text in terminal and press Ctrl-Shift-c to copy (to paste into terminal use Ctrl-Shift-v). Or use context menu of your terminal.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            G 1 Reply Last reply 18 Sept 2019, 00:52
            1
            • A aha_1980
              17 Sept 2019, 03:46

              @gibbogle ok, so if the examples work, it must be your project.

              Have you already wiped the build folder and .pro.user and rebuild your project?

              Are you linking external libs?

              Regards

              G Offline
              G Offline
              gibbogle
              wrote on 18 Sept 2019, 00:46 last edited by
              #17

              @aha_1980
              Yes, I just again wiped the build folder and .pro.user and rebuilt. No change.
              Yes, I am linking external libs.

              The program runs (Debug and Release) in a terminal.

              1 Reply Last reply
              0
              • J jsulm
                17 Sept 2019, 04:19

                @gibbogle said in Run environment in Qt Creator:

                it does not seem to be possible to copy-and-paste from the terminal

                It is possible: mark text in terminal and press Ctrl-Shift-c to copy (to paste into terminal use Ctrl-Shift-v). Or use context menu of your terminal.

                G Offline
                G Offline
                gibbogle
                wrote on 18 Sept 2019, 00:52 last edited by
                #18

                @jsulm
                When I do Ctrl-Shift-c all that happens is a ^C is displayed.
                I'm not sure what the context menu of the terminal is. If I right-click at the top I just get Minimize, Maximize, Move etc.

                J 1 Reply Last reply 19 Sept 2019, 11:52
                0
                • G gibbogle
                  18 Sept 2019, 00:52

                  @jsulm
                  When I do Ctrl-Shift-c all that happens is a ^C is displayed.
                  I'm not sure what the context menu of the terminal is. If I right-click at the top I just get Minimize, Maximize, Move etc.

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 19 Sept 2019, 11:52 last edited by
                  #19

                  @gibbogle said in Run environment in Qt Creator:

                  If I right-click at the top I just get Minimize

                  not at the top, but inside the terminal.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  G 1 Reply Last reply 19 Sept 2019, 21:20
                  1
                  • J jsulm
                    19 Sept 2019, 11:52

                    @gibbogle said in Run environment in Qt Creator:

                    If I right-click at the top I just get Minimize

                    not at the top, but inside the terminal.

                    G Offline
                    G Offline
                    gibbogle
                    wrote on 19 Sept 2019, 21:20 last edited by
                    #20

                    @jsulm
                    Sorry, I'm still not with you, right-click inside the terminal just highlights text. Is it possible that I have a different terminal program from your one? In the list of Applications on Ubuntu 18.04 I see XTerm and UXTerm. They both behave the same way. Do they need to be configured to have the behaviour you describe?

                    J 1 Reply Last reply 20 Sept 2019, 04:34
                    0
                    • G gibbogle
                      19 Sept 2019, 21:20

                      @jsulm
                      Sorry, I'm still not with you, right-click inside the terminal just highlights text. Is it possible that I have a different terminal program from your one? In the list of Applications on Ubuntu 18.04 I see XTerm and UXTerm. They both behave the same way. Do they need to be configured to have the behaviour you describe?

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 20 Sept 2019, 04:34 last edited by
                      #21

                      @gibbogle XTerm and UXTerm are not the standard terminals on default Ubuntu installation. You should try the one Ubuntu provides by default (I think it's the one from Gnome).

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      G 1 Reply Last reply 21 Sept 2019, 02:49
                      2
                      • J jsulm
                        20 Sept 2019, 04:34

                        @gibbogle XTerm and UXTerm are not the standard terminals on default Ubuntu installation. You should try the one Ubuntu provides by default (I think it's the one from Gnome).

                        G Offline
                        G Offline
                        gibbogle
                        wrote on 21 Sept 2019, 02:49 last edited by gibbogle
                        #22

                        @jsulm
                        I'll have a look around, but these are the only ones that Ubuntu 18.04 shows in the list of installed apps (by clicking on the 3x3-dot-grid icon.) There are odd things about this version, e.g. I installed gedit, but it doesn't show up in the list.

                        Edit: I had to install gnome-terminal, and I see that it provides some useful features.

                        1 Reply Last reply
                        1
                        • G Offline
                          G Offline
                          gibbogle
                          wrote on 23 Sept 2019, 05:12 last edited by
                          #23

                          Having another look at this:
                          Although I installed gnome-terminal, which supports copy-and-paste, when I run the Custom Executable in Qt Creator is still uses XTerm, which doesn't support copying.
                          When I run with Custom Executable a great number of messages are generated, and they don't mean much to me. I do see, however, reference to libraries in /usr/local/Qt-4.8.6/lib, and in /usr/lib/x86_64-linux-gnu. Neither of these directories is in my LD_LIBRARY_PATH, and I don't know why they are being searched. I do have Qt-4.8.6 installed. I am suspecting that somehow when invoked inside Creator, the program is doing something with 4.8.6 libraries, and this is causing the crash.
                          A reminder: the program runs correctly at a terminal.

                          J 1 Reply Last reply 23 Sept 2019, 05:15
                          0
                          • G gibbogle
                            23 Sept 2019, 05:12

                            Having another look at this:
                            Although I installed gnome-terminal, which supports copy-and-paste, when I run the Custom Executable in Qt Creator is still uses XTerm, which doesn't support copying.
                            When I run with Custom Executable a great number of messages are generated, and they don't mean much to me. I do see, however, reference to libraries in /usr/local/Qt-4.8.6/lib, and in /usr/lib/x86_64-linux-gnu. Neither of these directories is in my LD_LIBRARY_PATH, and I don't know why they are being searched. I do have Qt-4.8.6 installed. I am suspecting that somehow when invoked inside Creator, the program is doing something with 4.8.6 libraries, and this is causing the crash.
                            A reminder: the program runs correctly at a terminal.

                            J Offline
                            J Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 23 Sept 2019, 05:15 last edited by
                            #24

                            @gibbogle Can you show the errors/warnings you get?

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            G 1 Reply Last reply 23 Sept 2019, 10:00
                            0
                            • J jsulm
                              23 Sept 2019, 05:15

                              @gibbogle Can you show the errors/warnings you get?

                              G Offline
                              G Offline
                              gibbogle
                              wrote on 23 Sept 2019, 10:00 last edited by
                              #25

                              @jsulm
                              It looks like a few hundred lines, and unfortunately I can't copy and paste them, unless I can find a way to make Creator use the gnome terminal program. ...
                              OK, I just found out how to do that. This is horrendously long (more than 800 lines).

                              Oh, there is a strict limit on the number of characters. I'll copy the first lines and the last lines.
                              First 35 lines:
                              execve("/home/gib/vspheroid-fem/build-vspheroid-Qt3d-Release/vspheroid-Qt3d-first-try", ["/home/gib/vspheroid-fem/build-vs"...], 0x7ffdf2a51980 /* 55 vars */) = 0
                              brk(NULL) = 0x5618cdaba000
                              access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
                              access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
                              openat(AT_FDCWD, "/home/gib/bin/tls/x86_64/x86_64/libqwt.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                              stat("/home/gib/bin/tls/x86_64/x86_64", 0x7ffd269838a0) = -1 ENOENT (No such file or directory)
                              openat(AT_FDCWD, "/home/gib/bin/tls/x86_64/libqwt.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                              stat("/home/gib/bin/tls/x86_64", 0x7ffd269838a0) = -1 ENOENT (No such file or directory)
                              openat(AT_FDCWD, "/home/gib/bin/tls/x86_64/libqwt.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                              stat("/home/gib/bin/tls/x86_64", 0x7ffd269838a0) = -1 ENOENT (No such file or directory)
                              openat(AT_FDCWD, "/home/gib/bin/tls/libqwt.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                              stat("/home/gib/bin/tls", 0x7ffd269838a0) = -1 ENOENT (No such file or directory)
                              openat(AT_FDCWD, "/home/gib/bin/x86_64/x86_64/libqwt.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                              stat("/home/gib/bin/x86_64/x86_64", 0x7ffd269838a0) = -1 ENOENT (No such file or directory)
                              openat(AT_FDCWD, "/home/gib/bin/x86_64/libqwt.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                              stat("/home/gib/bin/x86_64", 0x7ffd269838a0) = -1 ENOENT (No such file or directory)
                              openat(AT_FDCWD, "/home/gib/bin/x86_64/libqwt.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
                              stat("/home/gib/bin/x86_64", 0x7ffd269838a0) = -1 ENOENT (No such file or directory)
                              openat(AT_FDCWD, "/home/gib/bin/libqwt.so.6", O_RDONLY|O_CLOEXEC) = 3
                              read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\32\7\0\0\0\0\0"..., 832) = 832
                              fstat(3, {st_mode=S_IFREG|0775, st_size=1626000, ...}) = 0
                              mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd843ba8000
                              mmap(NULL, 3432576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fd84363c000
                              mprotect(0x7fd843775000, 2097152, PROT_NONE) = 0
                              mmap(0x7fd843975000, 53248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x139000) = 0x7fd843975000
                              mmap(0x7fd843982000, 128, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fd843982000
                              close(3) = 0
                              openat(AT_FDCWD, "/home/gib/vspheroid-fem/build/Release/libvspheroid-fem.so", O_RDONLY|O_CLOEXEC) = 3
                              read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p$\1\0\0\0\0\0"..., 832) = 832
                              fstat(3, {st_mode=S_IFREG|0755, st_size=521272, ...}) = 0
                              mmap(NULL, 5435000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fd84310d000
                              mprotect(0x7fd84318a000, 2093056, PROT_NONE) = 0
                              mmap(0x7fd843389000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7c000) = 0x7fd843389000
                              mmap(0x7fd84338c000, 2817656, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fd84338c000
                              close(3) = 0

                              Last 21 lines
                              rt_sigaction(SIGRTMIN, {sa_handler=0x7fd839300cb0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7fd83930d890}, NULL, 8) = 0
                              rt_sigaction(SIGRT_1, {sa_handler=0x7fd839300d50, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fd83930d890}, NULL, 8) = 0
                              rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
                              prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
                              futex(0x7fd8392fa0c8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
                              brk(NULL) = 0x5618cdaba000
                              brk(0x5618cdadb000) = 0x5618cdadb000
                              rt_sigaction(SIGRT_32, {sa_handler=0x7fd832637820, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fd83b0c3f20}, NULL, 8) = 0
                              futex(0x7fd833f45f38, FUTEX_WAKE_PRIVATE, 2147483647) = 0
                              futex(0x7fd833f45f38, FUTEX_WAKE_PRIVATE, 2147483647) = 0
                              brk(0x5618cdafc000) = 0x5618cdafc000
                              openat(AT_FDCWD, "/dev/urandom", O_RDONLY|O_CLOEXEC) = 3
                              read(3, "19\374\220", 4) = 4
                              fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
                              fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
                              fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
                              fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
                              fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
                              fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
                              --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7fd83c15e5c0} ---
                              +++ killed by SIGSEGV (core dumped) +++

                              1 Reply Last reply
                              0
                              • G Offline
                                G Offline
                                gibbogle
                                wrote on 23 Sept 2019, 10:16 last edited by gibbogle
                                #26

                                There is something funny about the directories being searched. For example, in the above you can see:
                                /home/gib/bin/x86_64/libqwt.so.6
                                In fact that library is in /home/gib/bin, and there is no x86_64 subdirectory, in fact there are no subdirectories to /home/gib/bin.
                                In Projects > Build & Run > Run > Run Environment > Details I open a terminal by clicking Open Terminal, then inspect the LD_LIBRARY_PATH:

                                gib@gigabyte:~$ echo $LD_LIBRARY_PATH
                                /home/gib/Qt5.13.0/5.13.0/gcc_64/lib:/home/gib/qwt-6.1.3/lib:/home/gib/bin:/home/gib/OpenCMISS/opencmiss/install/lib:/home/gib/bin

                                You'll see that /home/gib/bin appears twice. That's because I found that I had to add the variable LD_LIBRARY_PATH with value /home/gib/bin to the Run environment, because otherwise the execution fails with the message that libqwt.so.6 cannot be found. This makes no sense to me, because /home/gib/bin is already in the path. I suspect that this odd behaviour is related to the crashing. It is as if LD_LIBRARY_PATH is somehow being corrupted.

                                Edit: I forgot to mention that libqwt.so.6 is in /home/gib/bin.

                                1 Reply Last reply
                                0

                                21/26

                                20 Sept 2019, 04:34

                                • Login

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