Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. qmake /bin/sh: OE_QMAKE_CXX: command not found?
Forum Updated to NodeBB v4.3 + New Features

qmake /bin/sh: OE_QMAKE_CXX: command not found?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
11 Posts 3 Posters 6.4k 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.
  • K kptt

    QMake version 3.0
    Using Qt version 5.7.0 in /home/kevin/sdk/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib

    I have a Qt project for which I have to build a toolchain. The toolchain is built using yocto's build system via "bitbake someproject_sdk". This generates the "environment-setup-cortexa9hf-neon-poky-linux-gnueabi" script which is used to setup my environment for application development. Mainly it sets up the env so that the correct compiler, assembler, linker, and debugger used for cross compilation are visible within the env.

    However, even after sourcing this environment setup script, qmake is having trouble with the environment variable OE_QMAKE_CXX and OE_QMAKE_CXXFLAGS. Sample output:

    /bin/sh: OE_QMAKE_CXX: command not found
    /bin/sh: OE_QMAKE_CXXFLAGS: command not found
    

    I see the above message in the "General Messages" tab in QtCreator (which is launched from the terminal session in which the env setup script was sourced). My first thought was to check to see if OE_QMAKE_CXX and OE_QMAKE_CXXFLAGS were defined by the env setup script, and sure enough they are:

    $ printenv | grep OE_QMAKE_CXX
    OE_QMAKE_CXX=arm-poky-linux-gnueabi-g++  -march=armv7-a -marm -mfpu=neon  -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/kevin/sdk/sysroots/cortexa9hf-neon-poky-linux-gnueabi
    OE_QMAKE_CXXFLAGS= -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/kevin/vp_project/build/tmp/work/x86_64-nativesdk-oesdk-linux/meta-environment-vpro-9200/1.0-r8=/usr/src/debug/meta-environment-vpro-9200/1.0-r8 -fdebug-prefix-map=/home/kevin/vp_project/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/home/kevin/vp_project/build/tmp/sysroots/x86_64-nativesdk-oesdk-linux=
    

    I can also produce this outside of QtCreator by invoking qmake from a terminal session which has already sourced the env setup script. Here I attempted to build a tiny simple "hello_world" project:

    $ qmake -project
    sh: OE_QMAKE_CXX: command not found
    sh: OE_QMAKE_CXXFLAGS: command not found
    

    In summary, I can see the OE_QMAKE_CXX and OE_QMAKE_CXXFLAGS are both defined within my terminal session, but qmake seems to think otherwise. Can anyone think of why that would be?

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

    @kptt Can you show your .pro file? You're probably using these variables wrongly.

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

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kptt
      wrote on last edited by kptt
      #3

      @jsulm This is my top level .pro file:

      1 TEMPLATE = subdirs
      2 SUBDIRS = \
      3     lib \
      4     examples
      5 
      6 !macx: { SUBDIRS += gpsd_plugin }
      7 
      8 #Some host installations have target dependencies installed in Qt root, not system root:
      9 !linux-oe-g++ {
      10     INCLUDEPATH += $$[QT_HOST_PREFIX]/usr/include
      11     LIBS += -L$$[QT_HOST_PREFIX]/usr/lib
      12 }
      13 
      14 examples.depends = lib
      

      I have three other small .pro files that build different parts of the project.

      I thought OE_QMAKE_CXX is supposed to point to the c++ cross compiler and OE_QMAKE_CXXFLAGS is supposed to contain all of the desired c++ compiler flags? Is it not? As far as I can tell, that's exactly what I'm doing.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Hi and welcome to devnet,

        Can you call arm-poky-linux-gnueabi-g++directly in your console ? If not then you should add the path to the folder containing it to the PATH environment variable.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        K 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          Can you call arm-poky-linux-gnueabi-g++directly in your console ? If not then you should add the path to the folder containing it to the PATH environment variable.

          K Offline
          K Offline
          kptt
          wrote on last edited by
          #5

          Hi @SGaist,

          Yes, I can invoke arm-poky-linx-gnueabi-g++ directly in my console (w/o a full path):

          kevin at kp-workstation in ~
          $ cd ~/sdk
          kevin at kp-workstation in ~/sdk
          $ ls
          environment-setup-cortexa9hf-neon-poky-linux-gnueabi
          relocate_sdk.py
          relocate_sdk.sh
          site-config-cortexa9hf-neon-poky-linux-gnueabi
          sysroots
          version-cortexa9hf-neon-poky-linux-gnueabi
          kevin at kp-workstation in ~/sdk
          $ . environment-setup-cortexa9hf-neon-poky-linux-gnueabi
          kevin at kp-workstation in ~/sdk
          $ cd ~/hello_world/
          kevin at kp-workstation in ~/hello_world
          $ ls
          qt_hello_world.cpp
          kevin at kp-workstation in ~/hello_world
          $ qmake -project
          sh: OE_QMAKE_CXX: command not found
          sh: OE_QMAKE_CXXFLAGS: command not found
          kevin at kp-workstation in ~/hello_world
          $ arm-poky-linux-gnueabi-g++
          arm-poky-linux-gnueabi-g++: fatal error: no input files
          compilation terminated.
          
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #6

            Which mkspec are you using ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            K 2 Replies Last reply
            0
            • SGaistS SGaist

              Which mkspec are you using ?

              K Offline
              K Offline
              kptt
              wrote on last edited by
              #7

              @SGaist linux-oe-g++

              1 Reply Last reply
              0
              • SGaistS SGaist

                Which mkspec are you using ?

                K Offline
                K Offline
                kptt
                wrote on last edited by
                #8

                @SGaist Looking at the build steps for my target in qtcreator, I found that the -spec option was omitted in the qmake step. I added it under additional arguments, but that didn't change anything.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  You should rather have a dedicated Kit where you configure that kind of stuff.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  K 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    You should rather have a dedicated Kit where you configure that kind of stuff.

                    K Offline
                    K Offline
                    kptt
                    wrote on last edited by kptt
                    #10

                    @SGaist Well, looking at the Details under the Qt Versions tab for my kit I do indeed see that mkspec, QMAKE_SPEC, QMAKE_XSPEC are all defined as "linux-oe-g++". That means the kit is configured for linux-oe-g++, correct?

                    Screenshot of Qt Versions Tab at 2016-10-05 16:32:20.png

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      Looks good.

                      Did you check the makespec itself to see if there some hardcoded path ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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