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

Unable to parse and build an application using AVR GCC compiler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 1.9.1
    • 1.9.0
    • Qt Creator Integration
    • None
    • * QtC 4.4.0 (official)
       * QBS 1.9.0 (delivered with QtC)
       * AVR GCC
       * Host OS Windows
       * Target Bare Metal Device
    • 4551429f1a30c2256a48e9fd0044a0e7567539ca

    Description

      1) I have added the GCC compilers from QtC for C and C++ targets, on options-> build&run->compilers tab (see gcc-avr-c.png, gcc-avr-c++.png):

      GCC AVR (C) -> C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-gcc.exe 
      
      GCC AVR (C+) -> C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-g++.exe

      2) I have added a new Bare Metal Device

      3) I have aded new non-qt AVR gcc Kit, based on AVR GCC compiler (see avr-kit.png)

      4) I have created an simple C-like qbs project application, using the QtC wizard.

      Attempt to opening for this application causes parsing errors like:

      C:\Qt-meta\Tools\QtCreator\share\qtcreator\qbs\share\qbs\modules\cpp\GenericGCC.qbs:261: warning: The following properties are not set. Set them in your profile or product: cpp.architecture: you might want to re-run 'qbs-setup-toolchains'

       5) Next, I have added the 'avr' architecture to qbs profile settings of selected AVR kit (see avr-qbs-profile-settings.png, avr-qbs-profile-settings-view.png):

      cpp.architecture avr
      qbs.architecture avr

       6) Now, the project was successfully parsed and the application has been successfully compiled

      avr.app.qbs:

      import qbs
      
      Project {
          minimumQbsVersion: "1.7.1"
          CppApplication {
              consoleApplication: true
              files: "main.c"
              Group {     // Properties for the produced executable
                  fileTagsFilter: product.type
                  qbs.install: true
              }
          }
      }
      

      main.c:

      int main()
      {
          return 0;
      }
      

       7) This command:

      avr-gcc -Wp,-dM -E -x c NUL > c:\Users\denis\Documents\avr-app\out.txt

      gives output in 'avr-gcc-info.log'

      Attachments

        1. avr-device.png
          avr-device.png
          34 kB
        2. avr-gcc-info.log
          14 kB
        3. avr-kit.png
          avr-kit.png
          49 kB
        4. avr-qbs-profile-settings.png
          avr-qbs-profile-settings.png
          5 kB
        5. avr-qbs-profile-settings-view.png
          avr-qbs-profile-settings-view.png
          41 kB
        6. gcc-avr-c.png
          gcc-avr-c.png
          48 kB
        7. gcc-avr-c++.png
          gcc-avr-c++.png
          48 kB
        For Gerrit Dashboard: QBS-1203
        # Subject Branch Project Status CR V

        Activity

          People

            jakepetroules Jake Petroules (DO NOT ASSIGN ISSUES)
            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