Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-897

Does not pick up C++ includes of cross-compiler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 1.4.3
    • Qt Creator Integration
    • None
    • * Ubuntu 14.04 LTS i386
      * ARM cross compiler: gnueabihf v4.8.x
      * QtCreator 3.5.1 (with included QBS 1.4.3)
      * Qt 5.5.1 (cross-compiled)

    Description

      When is used the cross-compiler:

      sudo apt-get install g++-arm-linux-gnueabihf

      and cross-compiled Qt for the embedded device with this compile options:

      DISTRO_OPTS += hard-float
      
      QMAKE_INCDIR += /usr/arm-linux-gnueabihf/include \
                      /usr/arm-linux-gnueabihf/include/c++/4.8.2 \
                      /usr/arm-linux-gnueabihf/include/c++/4.8.2/arm-linux-gnueabihf
      
      TEGRA_TK1_CFLAGS        = -mcpu=cortex-a15 -mfpu=neon-vfpv4 -marm
      QMAKE_CFLAGS           += $$TEGRA_TK1_CFLAGS
      QMAKE_CXXFLAGS         += $$TEGRA_TK1_CFLAGS
      

      then building any of simple C++ project :

      import qbs
      
      CppApplication {
          type: "application" // To suppress bundle generation on Mac
          consoleApplication: true
          files: "main.cpp"
      
          Group {     // Properties for the produced executable
              fileTagsFilter: product.type
              qbs.install: true
          }
      }
      
      #include <iostream>
      
      using namespace std;
      
      int main()
      {
          cout << "Hello World!" << endl;
          return 0;
      }
      

      fails with an following error:

      /home/builder/Projects/tests/qbs-test/main.cpp:1:20: fatal error: iostream: No such file or directory
      #include <iostream>
      ^
      compilation terminated.

      Though, any of C++ project using QMake is compiled without problems.

      A workaround it is specify the cpp.includePaths to the compiler includes in the QBS file:

          cpp.includePaths: [
              "/usr/arm-linux-gnueabihf/include",
              "/usr/arm-linux-gnueabihf/include/c++/4.8.2",
              "/usr/arm-linux-gnueabihf/include/c++/4.8.2/arm-linux-gnueabihf"
          ]
      

      Maybe need allow to import (pick-up) the QMAKE_INCDIR variable of the cross-compiled Qt to the QBS?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            kuzulis Denis Shienkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes