i installed qt4 on another computer with no visual studio, and finally i was able to build the hello qt program!!!
now i am trying another example from the book C++ gui programming with Qt4 and it also gives me compilation errors...
#include <QApplication>
#include <QDialog>
#include "ui_gotocelldialog.h"
int main(int argc, char *argv[])
{
Ui::GoToCellDialog ui;
ui.setupUi(dialog);
dialog->show();
return app.exec();
}
#include <QApplication>
#include <QDialog>
#include "ui_gotocelldialog.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Ui::GoToCellDialog ui;
QDialog *dialog = new QDialog;
ui.setupUi(dialog);
dialog->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
i have named the main form as GoToCellDialogm, and although this program doesn't do anything, i expected to have no problems compiling it....
C:\QT programming\test>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/QT programming/test'
c:\Qt\4.2.2\bin\uic.exe test.ui -o ui_test.h
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt
ime-pseudo-reloc -Wl,-subsystem,windows -o "debug\test.exe" -L"c:\Qt\4.2.2\lib
" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0xd): In function `Z13qAtomicSe
tPtrIP16QVectorTypedDataIPcEET_PVS4_S4_':
C:/Qt/4.2.2/include/QtCore/../../src/corelib/tools/qvector.h: undefined referenc
e to `std::string::size() const'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x60):C:/Qt/4.2.2/include/QtCor
e/../../src/corelib/tools/qvector.h: undefined reference to `std::string::operat
or[](unsigned int) const'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x9f):C:/Qt/4.2.2/include/QtCor
e/../../src/corelib/tools/qvector.h: undefined reference to `std::string::operat
or[](unsigned int) const'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0xce):C:/Qt/4.2.2/include/QtCor
e/../../src/corelib/tools/qvector.h: undefined reference to `std::string::operat
or[](unsigned int) const'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x10f): In function `WinMain':
C:/Qt/4.2.2/src/winmain/qtmain_win.cpp:68: undefined reference to `__gxx_persona
lity_sj0'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x30b):C:/Qt/4.2.2/src/winmain/
qtmain_win.cpp:105: undefined reference to `qMain(int, char**)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\test.exe] Error 1
mingw32-make[1]: Leaving directory `C:/QT programming/test'
mingw32-make: *** [debug] Error 2
C:\QT programming\test>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/QT programming/test'
c:\Qt\4.2.2\bin\uic.exe test.ui -o ui_test.h
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt
ime-pseudo-reloc -Wl,-subsystem,windows -o "debug\test.exe" -L"c:\Qt\4.2.2\lib
" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0xd): In function `Z13qAtomicSe
tPtrIP16QVectorTypedDataIPcEET_PVS4_S4_':
C:/Qt/4.2.2/include/QtCore/../../src/corelib/tools/qvector.h: undefined referenc
e to `std::string::size() const'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x60):C:/Qt/4.2.2/include/QtCor
e/../../src/corelib/tools/qvector.h: undefined reference to `std::string::operat
or[](unsigned int) const'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x9f):C:/Qt/4.2.2/include/QtCor
e/../../src/corelib/tools/qvector.h: undefined reference to `std::string::operat
or[](unsigned int) const'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0xce):C:/Qt/4.2.2/include/QtCor
e/../../src/corelib/tools/qvector.h: undefined reference to `std::string::operat
or[](unsigned int) const'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x10f): In function `WinMain':
C:/Qt/4.2.2/src/winmain/qtmain_win.cpp:68: undefined reference to `__gxx_persona
lity_sj0'
c:\Qt\4.2.2\lib/libqtmaind.a(qtmain_win.o)(.text+0x30b):C:/Qt/4.2.2/src/winmain/
qtmain_win.cpp:105: undefined reference to `qMain(int, char**)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\test.exe] Error 1
mingw32-make[1]: Leaving directory `C:/QT programming/test'
mingw32-make: *** [debug] Error 2
To copy to clipboard, switch view to plain text mode
is the code wrong??
Bookmarks