Results 1 to 4 of 4

Thread: Program won't compile since update from Qt5.4 to Qt5.5 | Error in Qt files?

  1. #1
    Join Date
    Oct 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Program won't compile since update from Qt5.4 to Qt5.5 | Error in Qt files?

    This is my old system where my program compiles just fine:
    Qt Code:
    1. qt5-base 5.4.1-2
    2. qt5-declarative 5.4.1-2
    3. qt5-doc 5.4.1-2
    4. qt5-graphicaleffects 5.5.0-2
    5. qt5-location 5.4.1-2
    6. qt5-quick1 5.4.1-2
    7. qt5-quickcontrols 5.4.1-2
    8. qt5-script 5.4.1-2
    9. qt5-sensors 5.4.1-2
    10. qt5-svg 5.4.1-2
    11. qt5-tools 5.4.1-2
    12. qt5-translations 5.4.1-2
    13. qt5-webchannel 5.4.1-2
    14. qt5-webkit 5.4.1-2
    15. qt5-xmlpatterns 5.4.1-2
    16. qtchooser 48-1
    17. qtcreator 3.3.2-1
    To copy to clipboard, switch view to plain text mode 

    After the update:
    Qt Code:
    1. qt5-base 5.5.0-2
    2. qt5-declarative 5.5.0-2
    3. qt5-doc 5.5.0-2
    4. qt5-graphicaleffects 5.5.0-2
    5. qt5-location 5.5.0-2
    6. qt5-quick1 5.5.0-2
    7. qt5-quickcontrols 5.5.0-2
    8. qt5-script 5.5.0-2
    9. qt5-sensors 5.5.0-2
    10. qt5-svg 5.5.0-2
    11. qt5-tools 5.5.0-2
    12. qt5-translations 5.5.0-2
    13. qt5-webchannel 5.5.0-2
    14. qt5-webkit 5.5.0-2
    15. qt5-xmlpatterns 5.5.0-2
    16. qtchooser 48-1
    17. qtcreator 3.5.0-1
    To copy to clipboard, switch view to plain text mode 

    This is the error I get:
    Qt Code:
    1. 17:23:23: Running steps for project graphit...
    2. 17:23:23: Configuration unchanged, skipping qmake step.
    3. 17:23:23: Starting: "/usr/bin/make"
    4. g++ -c -pipe -std=c++11 -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -std=c++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Iinclude -Iinclude/knowdesk -Ilibs -Ilibs -Ipodofo/include -Iexif/include -Iexif/include -isystem /usr/include/qt -isystem /usr/include/qt/QtQuick -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtCore -Ibuild -I/usr/lib/qt/mkspecs/linux-g++ -o build/controller.o src/controller.cpp
    5. In file included from /usr/include/qt/QtCore/qglobal.h:74:0,
    6. from /usr/include/qt/QtCore/qnamespace.h:37,
    7. from /usr/include/qt/QtCore/qobjectdefs.h:41,
    8. from /usr/include/qt/QtCore/qobject.h:40,
    9. from /usr/include/qt/QtCore/QObject:1,
    10. from src/controller.cpp:2:
    11. /usr/include/qt/QtCore/qurl.h:365:1: error: initializer provided for function
    12. Q_DECLARE_SHARED(QUrl)
    13. ^
    14. Makefile:975: recipe for target 'build/controller.o' failed
    15. make: *** [build/controller.o] Error 1
    16. 17:23:26: The process "/usr/bin/make" exited with code 2.
    17. Error while building/deploying project graphit (kit: Desktop)
    18. When executing step "Make"
    19. 17:23:26: Elapsed time: 00:03.
    To copy to clipboard, switch view to plain text mode 

    It seems like it fails compiling as soon as I include anything Q* in a .cpp file. Even if I remove the statements from src/controller.cpp, a similar error gets thrown in the next file where I include Q*. In it's always "initializer provided for function". A new project compiles fine and I can't pinpoint anything that causes the error in my project. Does anyone have an idea what causes the problem? I'm pretty desperate at this point, any help will be appreciated. I can also upload the source files if the error is too ambiguous.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Program won't compile since update from Qt5.4 to Qt5.5 | Error in Qt files?

    What are the first 5-10 lines of src/controller.cpp? If line 1 is an include of controller.h or something else from your sources then that file would be useful to see.

    What version of GCC?
    Are you doing a clean rebuild without any pre-compiled header lying about?

  3. #3
    Join Date
    Oct 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Program won't compile since update from Qt5.4 to Qt5.5 | Error in Qt files?

    controller.cpp
    Qt Code:
    1. #include "controller.h"
    2. #include <QObject>
    3. #include <QString>
    4. #include <QVariant>
    5. #include <QVariantList>
    6. #include <QVariantMap>
    7. #include <string>
    8. #include <vector>
    9. #include "controller.h"
    10. #include "itemcontroller.h"
    11. #include "modelcontroller.h"
    12. #include "knowdesk/knowledgeDB.h"
    13. #include "templatecontroller.h"
    14. #include "filecontroller.h"
    15. #include "libs/easylogging++.h"
    16.  
    17.  
    18. void Controller::setQuery(QueryController* q) {
    19. query = q;
    20. }
    21.  
    22. QueryController* Controller::getQuery() {
    23. return query;
    24. }
    25. .
    26. .
    27. .
    To copy to clipboard, switch view to plain text mode 

    controller.h
    Qt Code:
    1. #ifndef CONTROLLER_H
    2. #define CONTROLLER_H
    3.  
    4. class QueryController;
    5. class FileController;
    6. class ModelController;
    7. class TemplateController;
    8. class ItemController;
    9. class KnowledgeDB;
    10.  
    11. class Controller {
    12. public:
    13. void setQuery(QueryController*);
    14. QueryController* getQuery();
    15.  
    16. void setFile(FileController*);
    17. FileController* getFile();
    18.  
    19. void setModel(ModelController*);
    20. ModelController* getModel();
    21.  
    22. void setTemplate(TemplateController*);
    23. TemplateController* getTemplate();
    24.  
    25. void setItem(ItemController*);
    26. ItemController* getItem();
    27.  
    28. void setDB(KnowledgeDB*);
    29. KnowledgeDB* getDB();
    30. private:
    31. QueryController* query;
    32. FileController* file;
    33. ModelController* model;
    34. TemplateController* template_;
    35. ItemController* item;
    36. KnowledgeDB* db;
    37. };
    38.  
    39. #endif // CONTROLLER_H
    To copy to clipboard, switch view to plain text mode 

    I don't actually use any of the Q* in controller.cpp. If I remove the #include <Q*> statements, this error will be thrown in the next Header File that attempts to include Q*, itemcontroller.h:
    Qt Code:
    1. 02:25:07: Running steps for project graphit...
    2. 02:25:07: Configuration unchanged, skipping qmake step.
    3. 02:25:07: Starting: "/usr/bin/make"
    4. g++ -c -pipe -std=c++11 -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -std=c++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Iinclude -Iinclude/knowdesk -Ilibs -Ilibs -Ipodofo/include -Iexif/include -Iexif/include -isystem /usr/include/qt -isystem /usr/include/qt/QtQuick -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtCore -Ibuild -I/usr/lib/qt/mkspecs/linux-g++ -o build/controller.o src/controller.cpp
    5. In file included from /usr/include/qt/QtCore/qglobal.h:74:0,
    6. from /usr/include/qt/QtCore/qnamespace.h:37,
    7. from /usr/include/qt/QtCore/qobjectdefs.h:41,
    8. from /usr/include/qt/QtCore/qobject.h:40,
    9. from /usr/include/qt/QtCore/QObject:1,
    10. from include/itemcontroller.h:4,
    11. from src/controller.cpp:6:
    12. /usr/include/qt/QtCore/qurl.h:365:1: error: initializer provided for function
    13. Q_DECLARE_SHARED(QUrl)
    14. ^
    15. Makefile:975: recipe for target 'build/controller.o' failed
    16. make: *** [build/controller.o] Error 1
    17. 02:25:09: The process "/usr/bin/make" exited with code 2.
    18. Error while building/deploying project graphit (kit: Desktop)
    19. When executing step "Make"
    20. 02:25:09: Elapsed time: 00:03.
    To copy to clipboard, switch view to plain text mode 

    I have gcc version 5.2.0 and the same error appears after I delete all build files, rerun qmake and rebuild.

    I went back in my repo and found that the point where this compilation error first appears is when I change
    Qt Code:
    1. QApplication app(argc, argv);
    2. QQmlEngine engine;
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. QtQuickControlsApplication app(argc, argv);
    2. QQmlApplicationEngine engine;
    To copy to clipboard, switch view to plain text mode 
    But even after changing this in back in the main.cpp file, or even commenting everything there out, it fails much at other files. So I'm not sure if this relates.

  4. #4
    Join Date
    Oct 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Program won't compile since update from Qt5.4 to Qt5.5 | Error in Qt files?

    Here are the source files: http://ge.tt/13W34MP2/v/0
    You need SQLite and QtCreator as I haven't configured it for static build yet.
    I can offer to 0.08BTC (around 17€) for anyone who can help me.

Similar Threads

  1. Alert user when an update is available of my program
    By castors33 in forum Qt Programming
    Replies: 10
    Last Post: 16th March 2012, 18:37
  2. program compile problem: FT_Select_Size error
    By cooper in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2010, 23:52
  3. update the xml file from QT program
    By rk0747 in forum Newbie
    Replies: 5
    Last Post: 28th January 2010, 18:20
  4. Replies: 12
    Last Post: 17th June 2009, 05:34
  5. Replies: 2
    Last Post: 23rd November 2007, 17:44

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.