Results 1 to 7 of 7

Thread: Qt failing to compile claiming "fatal error: QObject: No such file or directory"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Qt failing to compile claiming "fatal error: QObject: No such file or directory"

    Hi!

    I have a project developed in Qt 4.8 for Embedded Linux and Linux that compiles fine. Now I'm trying to compile it in Qt 5.5.1 in Windows 7 and I got a problem I'm being unable to solve: each time I try to compile it, I get the error

    Qt Code:
    1. C:\Qt\Qt5.5\5.5\mingw492_32\bin\uic.exe interface\dialogs\alphanumerickeyboard.ui -o build\uis\ui_alphanumerickeyboard.h
    2. g++ -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DV_SERGIPETECH_0=0x100 -DV_SERGIPETECH_1=0x101 -DV_UNILA_0=0x110 -DGENERAL_VERSION_NUMBER=V_UNILA_0 -DAPP_VERSION=\"\" -DMAIN_CLOCK=1000 -DSCREENSAVER_SIMPLE_MODE -DCENTER_CONTROLLER -DPERIODIC_WIDGETS_UPDATE -DSAVE_ENTIRE_PQ -DDEFAULT_THEME_PATH='"D:/Desenvolvimento/RE8000SW/src/trunk/main_projects/interface/re8k_interface/../../..\main_projects\interface\theme"' -DDEFAULT_DATA_PATH='"D:/Desenvolvimento/RE8000SW/src/trunk/main_projects/interface/re8k_interface/../../..\main_projects\interface\data"' -DDEFAULT_TRANSLATION_PATH='"D:/Desenvolvimento/RE8000SW/src/trunk/main_projects/interface/re8k_interface/../../../main_projects/interface/translations"' -DDEFAULT_SCREENSHOT_PATH='"C:\Users\Administrador\Imagens\screenshots"' -DDEFAULT_RECORD_DIR='"C:\Users\Administrador\Documentos\TEMP\LogsRE8000"' -DDEFAULT_PENDRIVE_DIR='"C:\Users\Administrador\Documentos\TEMP\PendriveRE8000"' -DDEFAULT_VERSION_FILE_PATH='"C:\Users\Administrador\Documentos\TEMP\version.info"' -DCALIBRATION_FILE='"C:\Users\Administrador\Documentos\TEMP\caltouchpoints"' -DDEFAULT_ETC_PATH='"C:\Users\Administrador\Documentos\TEMP"' -DDESKTOP -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN qtextension/qcycleimagebutton.cpp -o qtextension/QCycleImageButton
    3. In file included from qtextension/qcycleimagebutton.cpp:1:0:
    4. qtextension/qcycleimagebutton.hpp:4:19: fatal error: QObject: No such file or directory
    5. #include <QObject>
    6. ^
    7. compilation terminated.
    To copy to clipboard, switch view to plain text mode 

    for the same file, which starts as such:

    Qt Code:
    1. #ifndef QCYCLEIMAGEBUTTON_H_
    2. #define QCYCLEIMAGEBUTTON_H_
    3.  
    4. #include <QObject>
    5. #include <QAbstractButton>
    6. #ifdef DESKTOP
    7. #include <QtDesigner/QDesignerExportWidget>
    8. #else
    9. #define QDESIGNER_WIDGET_EXPORT
    10. #endif
    11.  
    12. #include "interfaceglobal.hpp"
    13.  
    14. class QLabel;
    15. class QImageButtonIllustration;
    16. class QImageSliderIllustration;
    17.  
    18. typedef qint32 button_id;
    19.  
    20. class QDESIGNER_WIDGET_EXPORT QCycleImageButton : public QAbstractButton
    21. {
    22. Q_OBJECT
    To copy to clipboard, switch view to plain text mode 

    I can assure the Qt installation went OK since I created a QWidgets project and it compiled fine. I also checked if there was anything special in the Projects configuration but I couldn't find any problems there.

    I also tried to find solutions to this problem on the web, but nothing helpful was found. Here is my .pro file as for now (minus the .hpp and .cpp includes):

    Qt Code:
    1. QT += core gui xml network
    2. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    3.  
    4. #CONFIG += qwt
    5. #CONFIG += qwtpolar
    6.  
    7. RE8K_REPO = $${PWD}/../../..
    8. RE8K_COMMON = $${RE8K_REPO}/common
    9. RE8K_SDCARD = $${RE8K_REPO}/../../sdcard_files/defaultFiles
    10. RE8K_TRANSLATION = $${RE8K_REPO}/main_projects/interface/translations
    11.  
    12. VERSION = $$system(svn info -r HEAD . | grep 'Changed\ Rev' | cut -b 19-)
    13.  
    14. DEFINES += "GENERAL_VERSION_NUMBER=V_UNILA_0"
    15. DEFINES += APP_VERSION=\\\"$$VERSION\\\"
    16. #DEFINES += CLASSE_A_TEST
    17. #DEFINES += INTERFACE_DEMO #Special for the demo version
    18. DEFINES += MAIN_CLOCK=1000
    19.  
    20. DEFINES += SCREENSAVER_SIMPLE_MODE
    21. #DEFINES += DATASTREAM_THREAD
    22. DEFINES += CENTER_CONTROLLER
    23. DEFINES += PERIODIC_WIDGETS_UPDATE #Enable update by 1 sec of all top level widgets to counter black screen bug
    24. DEFINES += SAVE_ENTIRE_PQ #When selecting one item of a Physical Quantity makes all items be saved in a record
    25. #DEFINES += SAVE_XML_TEST
    26. #DEFINES += XML_WITH_COMMENTS
    27. #DEFINES += RELEASE_VERSION
    28. #DEFINES USE_FULL_CURRENT_RANGE_CONFIG #Enables current range of all 4 channels
    29.  
    30. INCLUDEPATH += $${RE8K_COMMON}/include
    31. INCLUDEPATH += qtextension
    32.  
    33. LIBS += -L$${RE8K_COMMON}/lib #needed for hal, etc.
    34. LIBS += -lQDeviceWatcher
    35.  
    36. CONFIG(debug, debug|release) {
    37. LIBS += -lmLoggerd
    38. }
    39.  
    40. CONFIG(release, debug|release) {
    41. LIBS += -lmLogger
    42. }
    43.  
    44. win32 {
    45. DEFINES += 'DEFAULT_THEME_PATH=\'\"$${RE8K_REPO}\main_projects\interface\theme\"\''
    46. DEFINES += 'DEFAULT_DATA_PATH=\'\"$${RE8K_REPO}\main_projects\interface\data\"\''
    47. DEFINES += 'DEFAULT_TRANSLATION_PATH=\'\"$${RE8K_TRANSLATION}\"\''
    48. DEFINES += 'DEFAULT_SCREENSHOT_PATH=\'\"C:\Users\Administrador\Imagens\screenshots\"\''
    49. DEFINES += 'DEFAULT_RECORD_DIR=\'\"C:\Users\Administrador\Documentos\TEMP\LogsRE8000\"\''
    50. DEFINES += 'DEFAULT_PENDRIVE_DIR=\'\"C:\Users\Administrador\Documentos\TEMP\PendriveRE8000\"\''
    51. DEFINES += 'DEFAULT_VERSION_FILE_PATH=\'\"C:\Users\Administrador\Documentos\TEMP\version.info\"\''
    52. DEFINES += 'CALIBRATION_FILE=\'\"C:\Users\Administrador\Documentos\TEMP\caltouchpoints\"\''
    53. DEFINES += 'DEFAULT_ETC_PATH=\'\"C:\Users\Administrador\Documentos\TEMP\"\''
    54.  
    55. DEFINES += DESKTOP
    56.  
    57. INCLUDEPATH += C:\Qt\Qwt-6.1.2\include
    58. INCLUDEPATH += C:\Qt\QwtPolar-1.1.1\include
    59. INCLUDEPATH += ..\..\..\third_party\mLogger\src
    60. INCLUDEPATH += ..\..\..\third_party\QDeviceWatcher\src
    61.  
    62. LIBS += -LC:\Qt\Qwt-6.1.2\lib
    63. LIBS += -LC:\Qt\QwtPolar-1.1.1\lib
    64.  
    65. TARGET = name_here
    66. }
    To copy to clipboard, switch view to plain text mode 

    Any help appreciated.
    Last edited by Momergil; 29th October 2015 at 16:28.
    May the Lord be with you. Always.

Similar Threads

  1. Replies: 12
    Last Post: 19th August 2015, 18:50
  2. Replies: 15
    Last Post: 6th March 2015, 13:34
  3. Replies: 2
    Last Post: 20th September 2013, 22:47
  4. "application has encountered a fatal error" on a Necessitas AVD
    By sedi in forum Installation and Deployment
    Replies: 1
    Last Post: 20th May 2012, 20:20
  5. Replies: 9
    Last Post: 20th May 2010, 09:55

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.