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. Parse error at "__attribute__"
Forum Updated to NodeBB v4.3 + New Features

Parse error at "__attribute__"

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 464 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.
  • A Offline
    A Offline
    Abu2023
    wrote on last edited by
    #1

    When I used QT6 to develop a desktop app, I got error:

    :/QT6.4/6.4.2/mingw_64/include/QtCore/qnamespace.:20:1: error: Parse error at "attribute"

    and here is the cmd:

    G:/QT6.4/6.4.2/mingw_64/./bin/moc.exe -DMINGW_HAS_SECURE_API=1 -DQT_CORE5COMPAT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NEEDS_QMAIN -DQT_NETWORK_LIB -DQT_WIDGETS_LIB -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -ID:/test/test04/ffmpeg-2.8.21/include -ID:/test/test04/SDL/include -IG:/QT6.4/6.4.2/mingw_64/include/QtCore -IG:/QT6.4/6.4.2/mingw_64/include -IG:/QT6.4/6.4.2/mingw_64/mkspecs/win32-g++ -IG:/QT6.4/6.4.2/mingw_64/include/QtWidgets -IG:/QT6.4/6.4.2/mingw_64/include/QtGui -IG:/QT6.4/6.4.2/mingw_64/include/QtCore5Compat -IG:/QT6.4/6.4.2/mingw_64/include/QtCore/6.4.2 -IG:/QT6.4/6.4.2/mingw_64/include/QtCore/6.4.2/QtCore -IG:/QT6.4/6.4.2/mingw_64/include/QtMultimedia -IG:/QT6.4/6.4.2/mingw_64/include/QtNetwork -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed -IG:/QT6.4/Tools/mingw1120_64/x86_64-w64-mingw32/include --include D:/test/build-test04-Desktop_Qt_6_4_2_MinGW_64_bit-Debug/test04_autogen/moc_predefs.h --output-dep-file -o D:/test/build-test04-Desktop_Qt_6_4_2_MinGW_64_bit-Debug/test04_autogen/EWIEGA46WW/moc_MainWindow.cpp D:/test/test04/MainWindow.h

    Could some help fix this?

    sierdzioS C 2 Replies Last reply
    0
    • A Abu2023

      When I used QT6 to develop a desktop app, I got error:

      :/QT6.4/6.4.2/mingw_64/include/QtCore/qnamespace.:20:1: error: Parse error at "attribute"

      and here is the cmd:

      G:/QT6.4/6.4.2/mingw_64/./bin/moc.exe -DMINGW_HAS_SECURE_API=1 -DQT_CORE5COMPAT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NEEDS_QMAIN -DQT_NETWORK_LIB -DQT_WIDGETS_LIB -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -ID:/test/test04/ffmpeg-2.8.21/include -ID:/test/test04/SDL/include -IG:/QT6.4/6.4.2/mingw_64/include/QtCore -IG:/QT6.4/6.4.2/mingw_64/include -IG:/QT6.4/6.4.2/mingw_64/mkspecs/win32-g++ -IG:/QT6.4/6.4.2/mingw_64/include/QtWidgets -IG:/QT6.4/6.4.2/mingw_64/include/QtGui -IG:/QT6.4/6.4.2/mingw_64/include/QtCore5Compat -IG:/QT6.4/6.4.2/mingw_64/include/QtCore/6.4.2 -IG:/QT6.4/6.4.2/mingw_64/include/QtCore/6.4.2/QtCore -IG:/QT6.4/6.4.2/mingw_64/include/QtMultimedia -IG:/QT6.4/6.4.2/mingw_64/include/QtNetwork -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed -IG:/QT6.4/Tools/mingw1120_64/x86_64-w64-mingw32/include --include D:/test/build-test04-Desktop_Qt_6_4_2_MinGW_64_bit-Debug/test04_autogen/moc_predefs.h --output-dep-file -o D:/test/build-test04-Desktop_Qt_6_4_2_MinGW_64_bit-Debug/test04_autogen/EWIEGA46WW/moc_MainWindow.cpp D:/test/test04/MainWindow.h

      Could some help fix this?

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @Abu2023 try Qt 6.4.3 perhaps? Or bump c++ standard to a higher one?

      (Z(:^

      A 1 Reply Last reply
      0
      • A Abu2023

        When I used QT6 to develop a desktop app, I got error:

        :/QT6.4/6.4.2/mingw_64/include/QtCore/qnamespace.:20:1: error: Parse error at "attribute"

        and here is the cmd:

        G:/QT6.4/6.4.2/mingw_64/./bin/moc.exe -DMINGW_HAS_SECURE_API=1 -DQT_CORE5COMPAT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NEEDS_QMAIN -DQT_NETWORK_LIB -DQT_WIDGETS_LIB -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -ID:/test/test04/ffmpeg-2.8.21/include -ID:/test/test04/SDL/include -IG:/QT6.4/6.4.2/mingw_64/include/QtCore -IG:/QT6.4/6.4.2/mingw_64/include -IG:/QT6.4/6.4.2/mingw_64/mkspecs/win32-g++ -IG:/QT6.4/6.4.2/mingw_64/include/QtWidgets -IG:/QT6.4/6.4.2/mingw_64/include/QtGui -IG:/QT6.4/6.4.2/mingw_64/include/QtCore5Compat -IG:/QT6.4/6.4.2/mingw_64/include/QtCore/6.4.2 -IG:/QT6.4/6.4.2/mingw_64/include/QtCore/6.4.2/QtCore -IG:/QT6.4/6.4.2/mingw_64/include/QtMultimedia -IG:/QT6.4/6.4.2/mingw_64/include/QtNetwork -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include -IG:/QT6.4/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed -IG:/QT6.4/Tools/mingw1120_64/x86_64-w64-mingw32/include --include D:/test/build-test04-Desktop_Qt_6_4_2_MinGW_64_bit-Debug/test04_autogen/moc_predefs.h --output-dep-file -o D:/test/build-test04-Desktop_Qt_6_4_2_MinGW_64_bit-Debug/test04_autogen/EWIEGA46WW/moc_MainWindow.cpp D:/test/test04/MainWindow.h

        Could some help fix this?

        C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        @Abu2023 What are all the headers included at the top of the cpp file?

        A 1 Reply Last reply
        0
        • C ChrisW67

          @Abu2023 What are all the headers included at the top of the cpp file?

          A Offline
          A Offline
          Abu2023
          wrote on last edited by
          #4

          @ChrisW67
          the headers included in file MainWindow.cpp are

          #include "MainWindow.h"
          #include "./ui_MainWindow.h"
          #include <QPainter>
          #ifdef Q_OS_ANDROID
          #include <QtCore/private/qandroidextras_p.h>
          #include <unistd.h>
          #endif
          #include <QCoreApplication>
          #include <QFuture>
          #include <QDebug>

          and headers included in MainWindow.h are
          #include <QMainWindow>
          #include <QImage>
          #include <QPaintEvent>
          #include "videoplayer.h"

          and headers included in videoplayer.h are
          #include <QObject>
          #include <QThread>
          #include <QImage>
          #include <QAudioOutput>
          #include <QAudioFormat>
          #include <QAudioSink>
          #include <QMediaDevices>

          headers included in videoplayer.cpp are
          #include "VideoPlayer.h"
          #include <QDebug>
          #include <QMessageBox>
          extern "C"
          {
          #include "libavcodec/avcodec.h"
          #include "libavformat/avformat.h"
          #include "libavutil/pixfmt.h"
          #include "libswscale/swscale.h"
          #include "libswresample/swresample.h"
          }
          #include <stdio.h>

          1 Reply Last reply
          0
          • sierdzioS sierdzio

            @Abu2023 try Qt 6.4.3 perhaps? Or bump c++ standard to a higher one?

            A Offline
            A Offline
            Abu2023
            wrote on last edited by Abu2023
            #5

            @sierdzio
            It seems that it is the MOC program can not handle "attribute", not g++.

            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