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. Qt Program failing through commands in terminal

Qt Program failing through commands in terminal

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 1.1k 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.
  • Pradeep KumarP Offline
    Pradeep KumarP Offline
    Pradeep Kumar
    wrote on last edited by
    #1

    Hello,

    i have ** Qt 5.7 ** installed in my ubuntu,

    1. If i use Qt creator and then build , then program compiles and i can run my executable.
    2. so if i try to build my program using commands , i will get error.

    The following error is when using commands

    these are the following errrors.

    a) when i use qmake SampleProgram.pro , it is taking from

    /opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-g++ -c -pipe -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=softfp -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/local/Qt-5.4.0/mkspecs/devices/linux-imx6-g++ -I../../SampleMake -I../../SampleMake -I/u01/rootfs/usr/local/Qt-5.4.0/include -I/u01/rootfs/usr/local/Qt-5.4.0/include/QtWidgets -I/u01/rootfs/usr/local/Qt-5.4.0/include/QtGui -I/u01/rootfs/usr/local/Qt-5.4.0/include/QtCore -I. -I/u01/rootfs/usr/include -I. -o main.o ../main.cpp

    b) when i use make - i am getting the following error.

    bash: ./SampleMake: cannot execute binary file: Exec format error

    the qmake its not taking from the installed Qt 5.7, please guide to run my program through commands also.

    Pradeep Kumar
    Qt,QML Developer

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Just use absolute path to qmake you want to use instead of only qmake:

      /path/to/qmake SampleProgram.pro
      

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

      1 Reply Last reply
      0
      • Pradeep KumarP Offline
        Pradeep KumarP Offline
        Pradeep Kumar
        wrote on last edited by
        #3

        it worked,

        the absolute path for generating the Make File.

        But any solution how i can set it to take default qmake.

        it is installed in the path :
        /home/username/Qt5.7.0/5.7/gcc_64/bin/qmake

        Pradeep Kumar
        Qt,QML Developer

        jsulmJ miclandM 2 Replies Last reply
        0
        • Pradeep KumarP Pradeep Kumar

          it worked,

          the absolute path for generating the Make File.

          But any solution how i can set it to take default qmake.

          it is installed in the path :
          /home/username/Qt5.7.0/5.7/gcc_64/bin/qmake

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

          @Pradeep-Kumar Well, you can add /home/username/Qt5.7.0/5.7/gcc_64/bin to PATH (at the beginning) but you really should not do that!
          You could write a small script where you set an alias:

          #!/bin/sh
          alias qmake=/home/username/Qt5.7.0/5.7/gcc_64/bin/qmake
          

          Make the script executable and execute it in the terminal where you want to build.

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

          1 Reply Last reply
          0
          • Pradeep KumarP Pradeep Kumar

            it worked,

            the absolute path for generating the Make File.

            But any solution how i can set it to take default qmake.

            it is installed in the path :
            /home/username/Qt5.7.0/5.7/gcc_64/bin/qmake

            miclandM Offline
            miclandM Offline
            micland
            wrote on last edited by
            #5

            @Pradeep-Kumar said:

            But any solution how i can set it to take default qmake.
            it is installed in the path :
            /home/username/Qt5.7.0/5.7/gcc_64/bin/qmake

            You can set a symlink in /usr/local/bin/:
            sudo ln -s /home/username/Qt5.7.0/5.7/gcc_64/bin/qmake /usr/local/bin/qmake

            (but that might be a problem if you have several users on that system because other users will see that symlink but can't access the qmake in your home directory).

            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