PDA

View Full Version : Project compile problems



MarkoSan
5th October 2009, 09:45
I try to compile my project and I get following errors:
Running build steps for project PresernMkI...
Starting: C:/Qt/2009.04/mingw/bin/mingw32-make.exe clean -w
mingw32-make: Entering directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
C:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Debug clean
mingw32-make[1]: Entering directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
del debug\moc_mainwindow.cpp debug\moc_stopwatchwidget.cpp debug\moc_clocklcdwidget.cpp debug\moc_stopwatchwidgetarea.cpp
del debug\main.o debug\mainwindow.o debug\centralwidget.o debug\stopwatchwidget.o debug\clocklcdwidget.o debug\stopwatchwidgetarea.o debug\moc_mainwindow.o debug\moc_stopwatchwidget.o debug\moc_clocklcdwidget.o debug\moc_stopwatchwidgetarea.o
Could Not Find C:\Users\Uporabnik\Desktop\PresernMkI\trunk\debug\ moc_mainwindow.cpp
mingw32-make[1]: Leaving directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
C:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Release clean
mingw32-make[1]: Entering directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
del release\moc_mainwindow.cpp release\moc_stopwatchwidget.cpp release\moc_clocklcdwidget.cpp release\moc_stopwatchwidgetarea.cpp
del release\main.o release\mainwindow.o release\centralwidget.o release\stopwatchwidget.o release\clocklcdwidget.o release\stopwatchwidgetarea.o release\moc_mainwindow.o release\moc_stopwatchwidget.o release\moc_clocklcdwidget.o release\moc_stopwatchwidgetarea.o
mingw32-make[1]: Leaving directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
mingw32-make: Leaving directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
Could Not Find C:\Users\Uporabnik\Desktop\PresernMkI\trunk\releas e\moc_mainwindow.cpp
Could Not Find C:\Users\Uporabnik\Desktop\PresernMkI\trunk\releas e\main.o
Exited with code 0.
Starting: C:/Qt/2009.04/qt/bin/qmake.exe C:/Users/Uporabnik/Desktop/PresernMkI/trunk/PresernMkI.pro -spec win32-g++ -r
Exited with code 0.
Starting: C:/Qt/2009.04/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
C:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2009.04\qt\include\QtCore" -I"c:\Qt\2009.04\qt\include\QtGui" -I"c:\Qt\2009.04\qt\include" -I"includes" -I"c:\qwt\src" -I"includes\StopWatchWidget" -I"c:\Qt\2009.04\qt\include\ActiveQt" -I"debug" -I"c:\Qt\2009.04\qt\mkspecs\win32-g++" -o debug\main.o src\main.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2009.04\qt\include\QtCore" -I"c:\Qt\2009.04\qt\include\QtGui" -I"c:\Qt\2009.04\qt\include" -I"includes" -I"c:\qwt\src" -I"includes\StopWatchWidget" -I"c:\Qt\2009.04\qt\include\ActiveQt" -I"debug" -I"c:\Qt\2009.04\qt\mkspecs\win32-g++" -o debug\mainwindow.o src\mainwindow.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2009.04\qt\include\QtCore" -I"c:\Qt\2009.04\qt\include\QtGui" -I"c:\Qt\2009.04\qt\include" -I"includes" -I"c:\qwt\src" -I"includes\StopWatchWidget" -I"c:\Qt\2009.04\qt\include\ActiveQt" -I"debug" -I"c:\Qt\2009.04\qt\mkspecs\win32-g++" -o debug\centralwidget.o src\centralwidget.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2009.04\qt\include\QtCore" -I"c:\Qt\2009.04\qt\include\QtGui" -I"c:\Qt\2009.04\qt\include" -I"includes" -I"c:\qwt\src" -I"includes\StopWatchWidget" -I"c:\Qt\2009.04\qt\include\ActiveQt" -I"debug" -I"c:\Qt\2009.04\qt\mkspecs\win32-g++" -o debug\stopwatchwidget.o src\StopWatchWidget\stopwatchwidget.cpp
src\StopWatchWidget\stopwatchwidget.cpp: In constructor `StopWatchWidget::StopWatchWidget(const QString&, QWidget*, Qt::WindowFlags, const quint64&)':
src\StopWatchWidget\stopwatchwidget.cpp:7: error: class `StopWatchWidget' does not have any field named `QDockWidget'
src\StopWatchWidget\stopwatchwidget.cpp:9: error: `setCurrentSecs' was not declared in this scope
src\StopWatchWidget\stopwatchwidget.cpp:11: error: `m_pWidgetArea' was not declared in this scope
src\StopWatchWidget\stopwatchwidget.cpp:11: error: `createWidgetArea' was not declared in this scope
src\StopWatchWidget\stopwatchwidget.cpp:27: error: 'class StopWatchWidget' has no member named 'setFloating'
src\StopWatchWidget\stopwatchwidget.cpp:28: error: 'class StopWatchWidget' has no member named 'setFeatures'
src\StopWatchWidget\stopwatchwidget.cpp:28: error: `QDockWidget' has not been declared
src\StopWatchWidget\stopwatchwidget.cpp:28: error: `NoDockWidgetFeatures' was not declared in this scope
src\StopWatchWidget\stopwatchwidget.cpp:29: error: 'class StopWatchWidget' has no member named 'setAllowedAreas'
src\StopWatchWidget\stopwatchwidget.cpp:31: error: 'class StopWatchWidget' has no member named 'setWidget'
src\StopWatchWidget\stopwatchwidget.cpp:31: error: `stopWatchWidgetArea' was not declared in this scope
src\StopWatchWidget\stopwatchwidget.cpp:9: warning: unused variable 'setCurrentSecs'
src\StopWatchWidget\stopwatchwidget.cpp:11: warning: unused variable 'm_pWidgetArea'
src\StopWatchWidget\stopwatchwidget.cpp:11: warning: unused variable 'createWidgetArea'
src\StopWatchWidget\stopwatchwidget.cpp:28: warning: unused variable 'NoDockWidgetFeatures'
src\StopWatchWidget\stopwatchwidget.cpp:31: warning: unused variable 'stopWatchWidgetArea'
src\StopWatchWidget\stopwatchwidget.cpp: At global scope:
src\StopWatchWidget\stopwatchwidget.cpp:45: error: expected constructor, destructor, or type conversion before '*' token
mingw32-make[1]: Leaving directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
mingw32-make: Leaving directory `C:/Users/Uporabnik/Desktop/PresernMkI/trunk'
mingw32-make[1]: *** [debug/stopwatchwidget.o] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project PresernMkI
When executing build step 'Make'What am I doing wrong, since I did NOT change sources since last succsesfull compilation (with qt 4.5.2, before installing 4.5.3)?

Sincerely,
Marko

caduel
5th October 2009, 10:03
Looking at your compiler's output: there is a bug (probably a missing #include) at line 45 of file src\StopWatchWidget\stopwatchwidget.cpp

MarkoSan
5th October 2009, 10:11
Well, I've checked that, I have all needed includes. Here is header file:
#ifndef STOPWATCHWIDGET_H #define STOPWATCHWIDGET_H
// system includes
#include <QtGui/QDockWidget>
// custom includes
//#include "ClockLCDWidget.h"
#include "StopWatchWidgetArea.h"
class StopWatchWidget : public QDockWidget
{
Q_OBJECT
private:
// ClockLCDWidget* m_pLCDWidget;
quint64 m_iCurrentSecs;
StopWatchWidgetArea* m_pWidgetArea;
StopWatchWidgetArea* createWidgetArea(); // creates widget area
// ClockLCDWidget* createLCDWidget(void);
public:
StopWatchWidget(const QString& strTitle=QString(tr("")),
QWidget* pParent=0,
Qt::WindowFlags flags=0,
const quint64& iStartingSecs=60);
// getter methods
/*
inline QSize sizeHint() const
{ return QSize(250, 120); }
*/
/*
inline ClockLCDWidget* lcdWidget(void) const
{ return m_pLCDWidget; }
*/
inline quint64 currentSecs() const
{ return m_iCurrentSecs; }
inline StopWatchWidgetArea* stopWatchWidgetArea() const
{ return m_pWidgetArea; }
// setter methods
inline void setCurrentSecs(const quint64& iSecs)
{ m_iCurrentSecs=iSecs; }
};
#endif // STOPWATCHWIDGET_Hand here is it's .cpp file:
#include "stopwatchwidget.h"
StopWatchWidget::StopWatchWidget(const QString& strTitle,
QWidget* pParent,
Qt::WindowFlags flags,
const quint64& iStartingSecs)
: QDockWidget(strTitle, pParent, flags)
{
setCurrentSecs(iStartingSecs); // inits secs
// m_pLCDWidget=createLCDWidget(); // creates LCD widget
m_pWidgetArea=createWidgetArea(); // cretes widget area
QSizePolicy sizePolicy(QSizePolicy::Fixed,
QSizePolicy::Fixed); // window's size policy
// size policy setup
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(this->sizePolicy().hasHeightForWidth());
// END OF size policy setup
this->setSizePolicy(sizePolicy); // sets window's size policy
this->setMinimumSize(QSize(250,
120));
this->setMaximumSize(QSize(250,
120));
this->setFloating(false);
this->setFeatures(QDockWidget::NoDockWidgetFeatures); // disables [X] and MOVE window buttons
this->setAllowedAreas(Qt::BottomDockWidgetArea);
// this->setWidget(lcdWidget()); // sets dock widget's contens
this->setWidget(stopWatchWidgetArea()); // sets dock's window contens widget
}
/*
ClockLCDWidget* StopWatchWidget::createLCDWidget(void)
{
ClockLCDWidget* pLCDWidget=new ClockLCDWidget(this); // creates LCD widget
Q_ASSERT_X(pLCDWidget!=0,
"LCD Widget creation",
"LCD Widget could not be created"); // checks creation
return pLCDWidget; // returns created object
}
*/
StopWatchWidgetArea* StopWatchWidget::createWidgetArea()
{
StopWatchWidgetArea* pStopWatchWidgetArea=new StopWatchWidgetArea(this); // creates new widget area
Q_ASSERT_X(pStopWatchWidgetArea!=0,
"Stopwatch widget area creation",
"Stopwatch widget area could not be created."); // checks creation
return pStopWatchWidgetArea; // returns widget area
}

caduel
5th October 2009, 10:22
maybe it helps if you write

#include <QDockWidget>
instead; I also would put

#ifndef STOPWATCHWIDGET_H #define STOPWATCHWIDGET_H
on two lines

MarkoSan
5th October 2009, 10:26
maybe it helps if you write

#include <QDockWidget>instead; I also would put

#ifndef STOPWATCHWIDGET_H #define STOPWATCHWIDGET_Hon two linesI did that, but same errors occur! :crying:

MarkoSan
6th October 2009, 07:59
No one has the idea what is wrong?!

lyuts
15th October 2009, 11:40
Try to do clean build.

MarkoSan
15th October 2009, 13:54
I have tried, same result ...