Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Error executing program after building in Qt Creator

Error executing program after building in Qt Creator

Scheduled Pinned Locked Moved Solved Mobile and Embedded
12 Posts 2 Posters 3.4k 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.
  • embdevE Offline
    embdevE Offline
    embdev
    wrote on last edited by
    #1

    Dear fellow coders, i'm currently using Qt 4.8 qmake (as my Qt 5.7 is not working properly at this juncture) to build my source codes.

    After building my source codes in Qt Creator 3.5.0 (i.e. my C source codes for embedded Linux board + simple Qt GUI interface), I set to run the executable program generated in [Release] folder in my Putty terminal. However it was unsuccessful and Putty terminal reported the following error:

    /mnt/Working folder/build-vdec_test-HI3536_Qt4_8-Release # ./vdec_test
    ./vdec_test: error while loading shared libraries: libdnvqe.so: cannot open shared file or directory

    I'm able to locate the directory of libdnvqe.so; I've also added this path into /etc/profile LD_LIBRARY_PATH.

    Did a reboot of my embedded Linux target in Putty terminal; run my program again but still met with the same problem.

    FYI, the missing library PATH is located via my NFS to my guest OS Ubuntu in virtualbox

    jsulmJ 1 Reply Last reply
    0
    • embdevE embdev

      Dear fellow coders, i'm currently using Qt 4.8 qmake (as my Qt 5.7 is not working properly at this juncture) to build my source codes.

      After building my source codes in Qt Creator 3.5.0 (i.e. my C source codes for embedded Linux board + simple Qt GUI interface), I set to run the executable program generated in [Release] folder in my Putty terminal. However it was unsuccessful and Putty terminal reported the following error:

      /mnt/Working folder/build-vdec_test-HI3536_Qt4_8-Release # ./vdec_test
      ./vdec_test: error while loading shared libraries: libdnvqe.so: cannot open shared file or directory

      I'm able to locate the directory of libdnvqe.so; I've also added this path into /etc/profile LD_LIBRARY_PATH.

      Did a reboot of my embedded Linux target in Putty terminal; run my program again but still met with the same problem.

      FYI, the missing library PATH is located via my NFS to my guest OS Ubuntu in virtualbox

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @embdev said in Error executing program after building in Qt Creator:

      FYI, the missing library PATH is located via my NFS to my guest OS Ubuntu in virtualbox

      Is that library built for x86? If so then it will not work. You need that library built for your target (I guess ARM?).
      You can check with

      file libdnvqe.so
      

      in the terminal.

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

      embdevE 1 Reply Last reply
      0
      • jsulmJ jsulm

        @embdev said in Error executing program after building in Qt Creator:

        FYI, the missing library PATH is located via my NFS to my guest OS Ubuntu in virtualbox

        Is that library built for x86? If so then it will not work. You need that library built for your target (I guess ARM?).
        You can check with

        file libdnvqe.so
        

        in the terminal.

        embdevE Offline
        embdevE Offline
        embdev
        wrote on last edited by embdev
        #3

        @jsulm that lib (libdnvqe.so) is for ARMS, that's for my target itself. Since i'm doing development work, i'm accessing my developmental files in my guest OS (Ubuntu). It's strange as I've configure the qmake to be using -static libraries so by right my compiled files shouldn't have dependencies issue?

        Details of the missing lib as per above:
        aa@aa:~/Hi3536_SDK_V2.0.4.0/mpp_single/lib$ file libdnvqe.so
        libdnvqe.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, stripped

        But is there a way to temporary link this missing library so that I can at least try out my compiled program in Qt?

        jsulmJ 1 Reply Last reply
        0
        • embdevE embdev

          @jsulm that lib (libdnvqe.so) is for ARMS, that's for my target itself. Since i'm doing development work, i'm accessing my developmental files in my guest OS (Ubuntu). It's strange as I've configure the qmake to be using -static libraries so by right my compiled files shouldn't have dependencies issue?

          Details of the missing lib as per above:
          aa@aa:~/Hi3536_SDK_V2.0.4.0/mpp_single/lib$ file libdnvqe.so
          libdnvqe.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, stripped

          But is there a way to temporary link this missing library so that I can at least try out my compiled program in Qt?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @embdev I'm not sure whether NFS could be the problem. You could try to put that library in the same directory as your executable to test.
          Do you have a static build of of this library?

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

          embdevE 1 Reply Last reply
          0
          • jsulmJ jsulm

            @embdev I'm not sure whether NFS could be the problem. You could try to put that library in the same directory as your executable to test.
            Do you have a static build of of this library?

            embdevE Offline
            embdevE Offline
            embdev
            wrote on last edited by
            #5

            @jsulm I tried putting the dynamic lib in the same directory as my executable but problem still persists though. I've the static build for this lib as well.

            Could it be also qmake not properly configured when compiling the sources? (Qt 4.8 sources)

            jsulmJ 1 Reply Last reply
            0
            • embdevE embdev

              @jsulm I tried putting the dynamic lib in the same directory as my executable but problem still persists though. I've the static build for this lib as well.

              Could it be also qmake not properly configured when compiling the sources? (Qt 4.8 sources)

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @embdev Can you run "ldd YOUR_EXECUTABLE" on your host machine and on the target and compare the output?

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

              embdevE 2 Replies Last reply
              0
              • jsulmJ jsulm

                @embdev Can you run "ldd YOUR_EXECUTABLE" on your host machine and on the target and compare the output?

                embdevE Offline
                embdevE Offline
                embdev
                wrote on last edited by embdev
                #7

                @jsulm I think the Linux 3.10.7 version i'm running on my embedded target is a scaled-down version so it doesn't contain the ldd command. Nonetheless I tried to run ldd (exe file) on my host machine but it says 'not a dynamic executable'. Did some quick search and executed another command to check the dependencies and came out with the following:

                It's surprising to see that the file is using shared libraries as I've configured qmake to use static lib during configuration, another thing to note is that all these libraries all reside in the same directory; hence the missing lib 'libdnvqe.so' should also be located by the exe though.

                aa@aa:~/Hi3536_SDK_V2.0.4.0/working folder/build-vdec_test-HI3536_Qt4_8-Release$ ldd vdec_test
                not a dynamic executable
                aa@aa:~/Hi3536_SDK_V2.0.4.0/working folder/build-vdec_test-HI3536_Qt4_8-Release$ readelf -a vdec_test | grep NEEDED
                0x00000001 (NEEDED) Shared library: [libdnvqe.so]
                0x00000001 (NEEDED) Shared library: [libhdmi.so]
                0x00000001 (NEEDED) Shared library: [libmpi.so]
                0x00000001 (NEEDED) Shared library: [libjpeg.so]
                0x00000001 (NEEDED) Shared library: [libupvqe.so]
                0x00000001 (NEEDED) Shared library: [libVoiceEngine.so]
                0x00000001 (NEEDED) Shared library: [libdl.so.2]
                0x00000001 (NEEDED) Shared library: [librt.so.1]
                0x00000001 (NEEDED) Shared library: [libpthread.so.0]
                0x00000001 (NEEDED) Shared library: [libstdc++.so.6]
                0x00000001 (NEEDED) Shared library: [libm.so.6]
                0x00000001 (NEEDED) Shared library: [libgcc_s.so.1]
                0x00000001 (NEEDED) Shared library: [libc.so.6]
                0x00000001 (NEEDED) Shared library: [ld-linux.so.3]

                1 Reply Last reply
                0
                • jsulmJ jsulm

                  @embdev Can you run "ldd YOUR_EXECUTABLE" on your host machine and on the target and compare the output?

                  embdevE Offline
                  embdevE Offline
                  embdev
                  wrote on last edited by
                  #8

                  @jsulm i managed to get this issue solved by manually copying the libraries into my embedded Linux target before executing the run again and was successful.

                  However 2 points for discussion here:

                  1. I should have a static executable file (configured qmake to have -static libraries) that i can run stand alone; but it appears that the exe file is using dynamic libraries.
                  2. my PATH could have been defined wrongly in /etc/profile in my embedded target Linux board:

                  the lib required are stored in /mpp_single/lib
                  LD_LIBRARY_PATH="/mnt/v1_QtEmbedded-4.8.6/lib/fonts:/mpp_single/lib:$LD_LIBRARY_PATH"

                  jsulmJ 1 Reply Last reply
                  0
                  • embdevE embdev

                    @jsulm i managed to get this issue solved by manually copying the libraries into my embedded Linux target before executing the run again and was successful.

                    However 2 points for discussion here:

                    1. I should have a static executable file (configured qmake to have -static libraries) that i can run stand alone; but it appears that the exe file is using dynamic libraries.
                    2. my PATH could have been defined wrongly in /etc/profile in my embedded target Linux board:

                    the lib required are stored in /mpp_single/lib
                    LD_LIBRARY_PATH="/mnt/v1_QtEmbedded-4.8.6/lib/fonts:/mpp_single/lib:$LD_LIBRARY_PATH"

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @embdev Many of the shared libraries you mentioned before are basic system libraries which are usually shared. I don't know whether it is easily possible to have them as static ones. But the question is: why do you care? Those libs are always there.
                    The other libs, like libdnvqe.so or libjpeg.so, are probably coming from Qt configured in a way to use system libraries. At least for some of these libraries it should be possible to tell the configure script to use what Qt provides instead of system libs.

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

                    embdevE 1 Reply Last reply
                    1
                    • jsulmJ jsulm

                      @embdev Many of the shared libraries you mentioned before are basic system libraries which are usually shared. I don't know whether it is easily possible to have them as static ones. But the question is: why do you care? Those libs are always there.
                      The other libs, like libdnvqe.so or libjpeg.so, are probably coming from Qt configured in a way to use system libraries. At least for some of these libraries it should be possible to tell the configure script to use what Qt provides instead of system libs.

                      embdevE Offline
                      embdevE Offline
                      embdev
                      wrote on last edited by
                      #10

                      @jsulm i think those shared lib generally have no issues. the libraries that were missing are actually from my embedded Linux SDK itself i.e. libnvqe.so, libhdmi.so, libmpi.so, libjpeg.so, libupvqe.so, libVoiceEngine.so which i also added the static versions of these vendor-provided lib in .pro file itself.

                      jsulmJ 1 Reply Last reply
                      0
                      • embdevE embdev

                        @jsulm i think those shared lib generally have no issues. the libraries that were missing are actually from my embedded Linux SDK itself i.e. libnvqe.so, libhdmi.so, libmpi.so, libjpeg.so, libupvqe.so, libVoiceEngine.so which i also added the static versions of these vendor-provided lib in .pro file itself.

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @embdev You mean in .pro file of your project? It will not help as Qt itself depends on them. For example libjpeg.so is used by Qt to be able to read JPEG images. But as far as I know you can configure Qt to not to use system provided libjpeg but its own version. Check the configure options.

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

                        embdevE 1 Reply Last reply
                        1
                        • jsulmJ jsulm

                          @embdev You mean in .pro file of your project? It will not help as Qt itself depends on them. For example libjpeg.so is used by Qt to be able to read JPEG images. But as far as I know you can configure Qt to not to use system provided libjpeg but its own version. Check the configure options.

                          embdevE Offline
                          embdevE Offline
                          embdev
                          wrote on last edited by
                          #12

                          @jsulm oh.. okies looks like I've to check out configure parameters again offline. Until then, i'll close this thread and focus on other threads. Thanks @jsulm! Greatly appreciated!

                          1 Reply Last reply
                          0

                          • Login

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