Results 1 to 17 of 17

Thread: Project suddenly doesn't compile

  1. #1
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Project suddenly doesn't compile

    I got a strange error when I was creating another form:
    Qt Code:
    1. ui_productsdialog.h:132: error: expected unqualified-id before ‘namespace’
    2. productsdialog.cpp:91: error: expected `}' at end of input
    To copy to clipboard, switch view to plain text mode 
    I couldn't figure out what was causing it as it seemed like the .ui file was corrupt or something, so I tried to clean the project and stared a new build, that's when hell broke loose. Now I get this error cropping up everywhere, I don't know what is causing it, this is the output:
    Qt Code:
    1. Configuration unchanged, skipping QMake step.
    2. Starting: /usr/bin/make -w
    3. make: Entering directory `/home/vince/projects/Qt/darwin-books'
    4. /usr/bin/uic-qt4 findAnyRecordDialog.ui -o ui_findAnyRecordDialog.h
    5. /usr/bin/uic-qt4 transactiondialog.ui -o ui_transactiondialog.h
    6. /usr/bin/uic-qt4 clientdetailsdialog.ui -o ui_clientdetailsdialog.h
    7. /usr/bin/uic-qt4 creditcarddialog.ui -o ui_creditcarddialog.h
    8. /usr/bin/uic-qt4 despatchrecorddialog.ui -o ui_despatchrecorddialog.h
    9. /usr/bin/uic-qt4 driverslicensedialog.ui -o ui_driverslicensedialog.h
    10. /usr/bin/uic-qt4 cashregisterdialog.ui -o ui_cashregisterdialog.h
    11. /usr/bin/uic-qt4 printdialog.ui -o ui_printdialog.h
    12. /usr/bin/uic-qt4 lookupproductdialog.ui -o ui_lookupproductdialog.h
    13. /usr/bin/uic-qt4 productsdialog.ui -o ui_productsdialog.h
    14. /usr/bin/uic-qt4 productdialog.ui -o ui_productdialog.h
    15. /usr/bin/uic-qt4 lookupentitydialog.ui -o ui_lookupentitydialog.h
    16. /usr/bin/uic-qt4 creditreturnsdialog.ui -o ui_creditreturnsdialog.h
    17. /usr/bin/uic-qt4 addressdialog.ui -o ui_addressdialog.h
    18. /usr/bin/uic-qt4 savedbchangesdialog.ui -o ui_savedbchangesdialog.h
    19. g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_SQL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4 -Iplugins/DbComboBoxExtension -I. -I. -o main.o main.cpp
    20. In file included from clientdetailsdialog.h:11,
    21. from transactiondialog.h:10,
    22. from MainWindow.h:9,
    23. from main.cpp:13:
    24. addressdialog.h:8: error: expected unqualified-id before ‘namespace’
    25. addressdialog.h:32: error: ISO C++ forbids declaration of ‘AddressDialog’ with no type
    26. addressdialog.h:32: error: invalid use of ‘::’
    27. addressdialog.h:32: error: expected ‘;’ before ‘*’ token
    28. In file included from transactiondialog.h:10,
    29. from MainWindow.h:9,
    30. from main.cpp:13:
    31. clientdetailsdialog.h:15: error: expected unqualified-id before ‘namespace’
    32. clientdetailsdialog.h:109: error: ISO C++ forbids declaration of ‘ClientDetailsDialog’ with no type
    33. clientdetailsdialog.h:109: error: invalid use of ‘::’
    34. clientdetailsdialog.h:109: error: expected ‘;’ before ‘*’ token
    35. In file included from transactiondialog.h:11,
    36. from MainWindow.h:9,
    37. from main.cpp:13:
    38. cashregisterdialog.h:7: error: expected unqualified-id before ‘namespace’
    39. cashregisterdialog.h:22: error: ISO C++ forbids declaration of ‘CashRegisterDialog’ with no type
    40. cashregisterdialog.h:22: error: invalid use of ‘::’
    41. cashregisterdialog.h:22: error: expected ‘;’ before ‘*’ token
    42. In file included from transactiondialog.h:12,
    43. from MainWindow.h:9,
    44. from main.cpp:13:
    45. lookupproductdialog.h:8: error: expected unqualified-id before ‘namespace’
    46. lookupproductdialog.h:26: error: ISO C++ forbids declaration of ‘LookupProductDialog’ with no type
    47. lookupproductdialog.h:26: error: invalid use of ‘::’
    48. lookupproductdialog.h:26: error: expected ‘;’ before ‘*’ token
    49. In file included from transactiondialog.h:13,
    50. from MainWindow.h:9,
    51. from main.cpp:13:
    52. lookupentitydialog.h:9: error: expected unqualified-id before ‘namespace’
    53. lookupentitydialog.h:26: error: ISO C++ forbids declaration of ‘LookupEntityDialog’ with no type
    54. lookupentitydialog.h:26: error: invalid use of ‘::’
    55. lookupentitydialog.h:26: error: expected ‘;’ before ‘*’ token
    56. In file included from MainWindow.h:9,
    57. from main.cpp:13:
    58. transactiondialog.h:17: error: expected unqualified-id before ‘namespace’
    59. transactiondialog.h:38: error: ISO C++ forbids declaration of ‘TransactionDialog’ with no type
    60. transactiondialog.h:38: error: invalid use of ‘::’
    61. transactiondialog.h:38: error: expected ‘;’ before ‘*’ token
    62. In file included from printdialog.h:3,
    63. from MainWindow.h:11,
    64. from main.cpp:13:
    65. ui_printdialog.h:132: error: expected unqualified-id before ‘namespace’
    66. main.cpp:91: error: expected `}' at end of input
    67. ui_printdialog.h:128: error: expected unqualified-id at end of input
    68. make: Leaving directory `/home/vince/projects/Qt/darwin-books'
    69. make: *** [main.o] Error 1
    70. Exited with code 2.
    71. Error while building project darwin-books
    72. When executing build step 'Make'
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Project suddenly doesn't compile

    Post some code

    Plus, don't you use source control? If so, just ask it for the list of changes. SC is invaluable for this alone.

  3. #3
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Project suddenly doesn't compile

    Quote Originally Posted by fatjuicymole View Post
    Post some code

    Plus, don't you use source control? If so, just ask it for the list of changes. SC is invaluable for this alone.
    No, I haven't setup any versioning, I prefer to do manual backups myself. Anyhow, the project hasn't been rebuilt for months so I don't know if it would help.

    Here is som code, they're all pretty much similar, automatically generated by Qt Creator with a few manual additions.
    Qt Code:
    1. #ifndef ADDRESSDIALOG_H
    2. #define ADDRESSDIALOG_H
    3.  
    4. #include <QtGui/QDialog>
    5. #include <QSqlQuery>
    6. #include "globaldatainstance.h"
    7.  
    8. namespace Ui {
    9. class AddressDialog;
    10. }
    11.  
    12. class AddressDialog : public QDialog {
    13. Q_OBJECT
    14. public:
    15. AddressDialog(QWidget *parent = 0);
    16. ~AddressDialog();
    17. void setAddressType(QString index);
    18. void setAddressText(QString text);
    19. void setAreacode(QString areaCode);
    20. void setLocaleText(QString text);
    21. QString getAddress();
    22. QString getAddressTypeText();
    23. QString getAddressType();
    24. QString getAreacode();
    25. QString getLocale();
    26.  
    27. protected:
    28. void changeEvent(QEvent *e);
    29. bool eventFilter(QObject *obj, QEvent *ev);
    30.  
    31. private:
    32. Ui::AddressDialog *m_ui;
    33. QString currentLocalesText;
    34. void initForm();
    35. void processEnterEvent();
    36. // Database data for access everywhere...
    37. GlobalDataInstance *globalData;
    38.  
    39. private slots:
    40. void on_pbCancel_clicked();
    41. void on_pbOK_clicked();
    42. };
    43.  
    44. #endif // ADDRESSDIALOG_H
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #ifndef TRANSACTIONDIALOG_H
    2. #define TRANSACTIONDIALOG_H
    3. #include <QMenuBar>
    4. #include <QtGui/QDialog>
    5. #include <QStatusBar>
    6. #include <QStatusTipEvent>
    7. #include <QtSql>
    8. #include <QSqlQuery>
    9. #include <QSqlQueryModel>
    10. #include "clientdetailsdialog.h"
    11. #include "cashregisterdialog.h"
    12. #include "lookupproductdialog.h"
    13. #include "lookupentitydialog.h"
    14. #include "transactionitemsmodel.h"
    15. #include "globaldatainstance.h"
    16.  
    17. namespace Ui {
    18. class TransactionDialog;
    19. }
    20.  
    21. class TransactionDialog : public QDialog {
    22. Q_OBJECT
    23. Q_DISABLE_COPY(TransactionDialog)
    24. public:
    25. // explicit TransactionDialog(QWidget *parent = 0);
    26. explicit TransactionDialog(QWidget *parent = 0, QString anID="");
    27. virtual ~TransactionDialog();
    28. public slots:
    29. ... lots of variables and methods follow...
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #ifndef MainWindow_H
    2. #define MainWindow_H
    3. #include <QMainWindow>
    4. #include <QLabel>
    5. #include <QCloseEvent>
    6. #include "findAnyRecordDialog.h"
    7. #include "productdialog.h"
    8. #include "productsdialog.h"
    9. #include "transactiondialog.h"
    10. #include "getuseriddialog.h"
    11. #include "printdialog.h"
    12. #include "globaldatainstance.h"
    13.  
    14. class FindAnyRecordDialog;
    15. class GetUserIdDialog;
    16. class QMdiArea;
    17.  
    18. class MainWindow : public QMainWindow
    19. {
    20. Q_OBJECT
    21.  
    22. public:
    23. MainWindow();
    24.  
    25. protected:
    26. void closeEvent(QCloseEvent *event);
    27. // blah blah blah...
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Project suddenly doesn't compile

    Try to give the relative path, like
    Qt Code:
    1. #include<QtCore/QSqlQuery>
    To copy to clipboard, switch view to plain text mode 
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project suddenly doesn't compile

    I would guess you forgot to close a bracket or forgot about a semicolon in a file which is included just before your "faulty" ui_productsdialog.h file.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Project suddenly doesn't compile

    Quote Originally Posted by phillip_Qt View Post
    Try to give the relative path, like
    Qt Code:
    1. #include<QtCore/QSqlQuery>
    To copy to clipboard, switch view to plain text mode 
    QSqlQuerry is in the QtSql module and show us your globaldatainstance.h, there is probably a syntax error.

  7. #7
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Project suddenly doesn't compile

    Quote Originally Posted by Lykurg View Post
    QSqlQuerry is in the QtSql module and show us your globaldatainstance.h, there is probably a syntax error.
    EDIT: too late...

    ARGH, and that should be an edit not a "post Reply"

  8. #8
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Project suddenly doesn't compile

    I don't think there's a missing "}" anywhere because it's occurring on code that's been working for months.

    Here's the code for globaldatainstance.h
    It too has been working for months and I can't see any errors in it...
    Qt Code:
    1. #ifndef GLOBALDATAINSTANCE_H
    2. #define GLOBALDATAINSTANCE_H
    3.  
    4. #include <QtSql/QSqlQuery>
    5.  
    6. class GlobalDataInstance
    7. {
    8. public:
    9. static GlobalDataInstance* Instance();
    10. QStringList getCatItems(int cat_code, int start, int end, bool concatentReturnCode);
    11. QString getCurrentUserName();
    12. QString getCurrentUserId();
    13. QString getCurrentUserAccessLevel();
    14. void setCurrentUserName(QString);
    15. void setCurrentUserId(QString);
    16. void setCurrentUserAccessLevel(QString);
    17. void clearUser();
    18. bool refreshCatCodes();
    19. protected:
    20. GlobalDataInstance();
    21. GlobalDataInstance(const GlobalDataInstance&);
    22. GlobalDataInstance& operator= (const GlobalDataInstance&);
    23. private:
    24. // hmmmmmmm...static....what is it .. really ??
    25. static GlobalDataInstance* pinstance;
    26. // QSqlQuery is NOT a static member, but retains it's data !
    27. QSqlQuery categoryCodes;
    28. // These QString values are static members, must find out some time later if they really need be.
    29. static QString currentUserName;
    30. static QString currentUserId;
    31. static QString currentUserAccessLevel;
    32. };
    33.  
    34. #endif // GLOBALDATAINSTANCE_H
    To copy to clipboard, switch view to plain text mode 

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project suddenly doesn't compile

    What about other files? I'm almost sure there is a semi-colon missing after a class declaration in one of your files. You have to check them all.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Project suddenly doesn't compile

    The first error is at ui_productsdialog.h:132 according to your first message, and since you didn't post that much of that file, I don't see how we can fix it for you. Maybe attach the files to a message rather than pasting them in the text?

  11. #11
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Project suddenly doesn't compile

    Quote Originally Posted by wysota View Post
    What about other files? I'm almost sure there is a semi-colon missing after a class declaration in one of your files. You have to check them all.
    Well, that's what you'd think, but not so.
    I removed the last dialog I created from the project and everything came good.
    I then restored the dialog files and removed all the extra code I added to the .h and .cpp files generated, problem returned.
    I come to the conclusion that something has gone corrupt in the .ui file, but a scan of it doesn't reveal anything obvious, even deleting objects and rebuilding still would not compile. I remember seeing this once before. Deleting the files and recreating them from new cleared the problem but I don't know where the problem lies, here is the corrupt(?) .ui file, maybe you can see if it builds for you ?

    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <ui version="4.0">
    3. <class>ProductsDialog</class>
    4. <widget class="QDialog" name="ProductsDialog">
    5. <property name="geometry">
    6. <rect>
    7. <x>0</x>
    8. <y>0</y>
    9. <width>578</width>
    10. <height>487</height>
    11. </rect>
    12. </property>
    13. <property name="windowTitle">
    14. <string>Dialog</string>
    15. </property>
    16. <property name="styleSheet">
    17. <string>QLineEdit{
    18. background-color: rgb(255, 255, 235);
    19. border: 1px solid gray;
    20. border-radius: 3px;
    21. }
    22.  
    23. background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
    24. stop: 0 #E0E0E0, stop: 1 #FFFFFF);
    25. border: 1px solid gray;
    26. border-radius: 5px;
    27. margin-top: 1ex; /* leave space at the top for the title */
    28. }
    29.  
    30. QGroupBox::title {
    31. subcontrol-origin: margin;
    32. subcontrol-position: top left; /* position at the top center */
    33. padding: 0 3px;
    34. }
    35. </string>
    36. </property>
    37. <layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0,0">
    38. <property name="sizeConstraint">
    39. <enum>QLayout::SetDefaultConstraint</enum>
    40. </property>
    41. <item row="0" column="1">
    42. <widget class="QGroupBox" name="groupBox">
    43. <property name="title">
    44. <string>Show</string>
    45. </property>
    46. <layout class="QVBoxLayout" name="verticalLayout">
    47. <property name="spacing">
    48. <number>0</number>
    49. </property>
    50. <property name="leftMargin">
    51. <number>4</number>
    52. </property>
    53. <property name="topMargin">
    54. <number>6</number>
    55. </property>
    56. <property name="rightMargin">
    57. <number>4</number>
    58. </property>
    59. <property name="bottomMargin">
    60. <number>6</number>
    61. </property>
    62. <item>
    63. <widget class="QCheckBox" name="checkBox_10">
    64. <property name="text">
    65. <string>&amp;All Records</string>
    66. </property>
    67. </widget>
    68. </item>
    69. <item>
    70. <widget class="QCheckBox" name="checkBox_11">
    71. <property name="text">
    72. <string>A&amp;vailable</string>
    73. </property>
    74. </widget>
    75. </item>
    76. <item>
    77. <widget class="QCheckBox" name="checkBox_12">
    78. <property name="text">
    79. <string>&amp;In Stock</string>
    80. </property>
    81. </widget>
    82. </item>
    83. <item>
    84. <widget class="QCheckBox" name="checkBox_13">
    85. <property name="text">
    86. <string>A&amp;llocated</string>
    87. </property>
    88. </widget>
    89. </item>
    90. <item>
    91. <widget class="QCheckBox" name="checkBox_14">
    92. <property name="text">
    93. <string>Lo&amp;w Stock</string>
    94. </property>
    95. </widget>
    96. </item>
    97. <item>
    98. <widget class="QCheckBox" name="checkBox_15">
    99. <property name="text">
    100. <string>&amp;To Order</string>
    101. </property>
    102. </widget>
    103. </item>
    104. <item>
    105. <widget class="QCheckBox" name="checkBox_16">
    106. <property name="text">
    107. <string>O&amp;n Back-Order</string>
    108. </property>
    109. </widget>
    110. </item>
    111. <item>
    112. <widget class="QCheckBox" name="checkBox_17">
    113. <property name="text">
    114. <string>&amp;Discontinued</string>
    115. </property>
    116. <property name="tristate">
    117. <bool>true</bool>
    118. </property>
    119. </widget>
    120. </item>
    121. </layout>
    122. </widget>
    123. </item>
    124. <item row="1" column="0" colspan="2">
    125. <widget class="QTableView" name="tableView"/>
    126. </item>
    127. <item row="2" column="0" colspan="2">
    128. <layout class="QHBoxLayout" name="horizontalLayout">
    129. <item>
    130. <widget class="QPushButton" name="pushButton">
    131. <property name="text">
    132. <string>Refresh - F8</string>
    133. </property>
    134. </widget>
    135. </item>
    136. <item>
    137. <widget class="QPushButton" name="pushButton_2">
    138. <property name="text">
    139. <string>Cancel - Esc</string>
    140. </property>
    141. </widget>
    142. </item>
    143. <item>
    144. <widget class="QPushButton" name="pushButton_3">
    145. <property name="text">
    146. <string>Clear - F9</string>
    147. </property>
    148. </widget>
    149. </item>
    150. <item>
    151. <widget class="QPushButton" name="pushButton_4">
    152. <property name="text">
    153. <string>Help - F1</string>
    154. </property>
    155. </widget>
    156. </item>
    157. <item>
    158. <spacer name="horizontalSpacer_2">
    159. <property name="orientation">
    160. <enum>Qt::Horizontal</enum>
    161. </property>
    162. <property name="sizeHint" stdset="0">
    163. <size>
    164. <width>40</width>
    165. <height>20</height>
    166. </size>
    167. </property>
    168. </spacer>
    169. </item>
    170. </layout>
    171. </item>
    172. </layout>
    173. </widget>
    174. <resources/>
    175. <connections/>
    176. </ui>
    To copy to clipboard, switch view to plain text mode 

  12. #12
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Project suddenly doesn't compile

    Quote Originally Posted by fatjuicymole View Post
    The first error is at ui_productsdialog.h:132 according to your first message, and since you didn't post that much of that file, I don't see how we can fix it for you. Maybe attach the files to a message rather than pasting them in the text?
    Yes that's correct, that's the file that created this problem, and it was a generated file too!
    I didn't think there could be an error in a generated file, so I didn't post it. It's possible I've uncovered a bug with the GUI builder itself.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project suddenly doesn't compile

    Why do you change generated files manually? Didn't you see a warning not to do that?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  14. #14
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Project suddenly doesn't compile

    Quote Originally Posted by wysota View Post
    Why do you change generated files manually? Didn't you see a warning not to do that?
    Of course ! Not the ui file, the .h and .cpp files that get generated.

  15. #15
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project suddenly doesn't compile

    Quote Originally Posted by vieraci View Post
    Not the ui file, the .h and .cpp files that get generated.
    Which still means you are modifying generated files.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  16. #16
    Join Date
    Jun 2016
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Project suddenly doesn't compile

    Quote Originally Posted by wysota View Post
    Which still means you are modifying generated files.


    Subject is old, but steal present (and i not see any resolved solution).
    Im' very surprise by the answer of a "certified Nokia Dev ofQt framework". Like other guys, i'm surprise because .h and .cpp files are automatically generated but have to be modified for construct something more than "just a GUI design without functionality".
    So, this is that every-body do currently when they make job: modify .h and .cpp files from generated QtDesigner IDE tool.

    I also hope to know if this problem has been resolved or not, and how.
    I can see other place that this error is typaclly an error who can be from other files never show by the error... other people had similar problems.

    But now currently, i use git versionning, and look at last commit to point the error... i can not see any.
    Then i remove last files/class/QDialog created to see if the erorr disapear... but not !
    Also, the error, same has vince, is on a file/QWidget who has always worked parfectly before this day, and there is no change on that file too...

    There is sure a reason from somewhere, but not from file who never been change before the error happens... and the best idea for QT devs should be to try to find instead of lie on facts: .h and .cpp files has to be modified for use Qt framework (not ui_...h file for sure... but no one do that here, so tis is unrelevent and never resolve the problem).

    So... @vince, if you steal use Qt, did you find a solution and would you like to share it with us here please ?
    And other who know things,did you have an idea around this kind of typed error ?

    thanks for help and share your knows.


    Added after 1 4 minutes:


    Find the solution and the explication of this kind of typic problem:
    Some compilers never point the origin of problem for some spécifics errors.
    You steal need to look at class creation definition, mine was an unrelated file who has end of definition class "};" removed (cats on the desktop runing on keyboard...).
    so... because of one class miss end of declaration "};", an other strange error (where some other people had to figth with allready) occurs.

    Definitely nothing to do with ui_XXXXX.h file who has not moved at all, or with modified as normal use from devs .h and .cpp linked files.
    Also, have a git/svn or other versionning tool should help for point these kind of error that some compilers are not able to show the origin. (oher people had same problem and share that, compiled with clang will show the real origin of the bug).

    The technic for debugging this for me was also to use a good tools for search track files content (mine was free reggexer on linux) for point related headers files who used this class (or file where this class is declared) the compiler is talking about. Then, you will have all files who call or use this class, and for sure, the problem is inside one of these files... and same i could see on other blog/dicuss, every body has same kind of missing end of definition class "};" or ";" somewhere in header files.

    Thanks for sharing.
    Last edited by Jerome___; 7th June 2016 at 06:20.

  17. #17
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Project suddenly doesn't compile

    Quote Originally Posted by Jerome___ View Post
    Like other guys, i'm surprise because .h and .cpp files are automatically generated but have to be modified for construct something more than "just a GUI design without functionality".
    Generated files are never modified, it is also never necessary.

    Quote Originally Posted by Jerome___ View Post
    So, this is that every-body do currently when they make job: modify .h and .cpp files from generated QtDesigner IDE tool.
    Nobody ever does that.
    Also designer doesn't create .h or .cpp files, it writes to .xml files.
    UIC can be used to generated code from that and put it into a .h file.

    Cheers,
    _

Similar Threads

  1. Project compile problems
    By MarkoSan in forum Qt Programming
    Replies: 7
    Last Post: 15th October 2009, 13:54
  2. Qwt based project compile problem
    By MarkoSan in forum Qwt
    Replies: 0
    Last Post: 28th September 2009, 16:08
  3. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 06:34
  4. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 08:18
  5. Project won't compile under Windows (works under Linux)
    By philski in forum Qt Programming
    Replies: 7
    Last Post: 14th September 2006, 16:29

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.