C++ GUI Programming with Qt 4英文原版书上第二章的例子:Chapter 2. Creating Dialogs Rapid Dialog Design
完全按书上写的代码
wangjun@wj-dt:~/qt/qt-book-test/chap02/gotocell2$ ls
gotocell2.pro gotocelldialog.h main.cpp
gotocelldialog.cpp gotocelldialog.ui
qmake -project
qmake-qt4 gotocell2.pro
然后make
- wangjun@wj-dt:~/qt/qt-book-test/chap02/gotocell2$ make
- /usr/bin/uic-qt4 gotocelldialog.ui -o ui_gotocelldialog.h
- g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -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 -I. -I. -I. -o main.o main.cpp
- g++ -Wl,-O1 -o gotocell2 main.o -L/usr/lib -lQtGui -lQtCore -lpthread
- main.o: In function `main':
- main.cpp:(.text+0x51): undefined reference to `GoToCellDialog::GoToCellDialog(QWidget*)'
- collect2: ld returned 1 exit status
- make: *** [gotocell2] 错误 1
开始以为自己那里抄写错误,就在网上下了源代码后直接编译,也是提示这个错误
我就接着编译其他例子,也会提示这种错误
这种情况就应该是为自己Qt的问题了
希望各位帮帮忙,处女贴奉上了
编译时的源代码,网上下载的
gotocell2.tar.gz (2 K) 下载次数:4 [ 此帖被wangjun403在2009-11-10 14:54重新编辑 ]