GTK入门教程、GTK详解、Anjuta中文手册(更新中)

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的问题了

求助!!!
附件:
文件注释: qt源码,各位可以帮为看看除了什么问题
gotocell2.tar.gz [1.19 KiB]
被下载 6 次

作者: wangjun403   发布时间: 2009-11-09

我的情况跟你差不多啊。。
lee@lee-laptop:~/c$ make
/usr/bin/qmake-qt4 -unix -o Makefile c.pro
gcc -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. -o micro.o micro.c
micro.c: In function ‘main’:
micro.c:16: error: expected expression before ‘[’ token
micro.c:20: error: subscripted value is neither array nor pointer
micro.c:23: error: expected declaration or statement at end of input
micro.c:23: error: expected declaration or statement at end of input
make: *** [micro.o] 错误 1
好心人帮忙~

作者: liguanyao   发布时间: 2009-11-10

那是因为GoToCellDialog()这个函数你还没实现呢。
看下一章,就有了。

作者: sclzmbie   发布时间: 2009-11-13

我的是提示ld error:not find -lqt;

作者: md5xwl   发布时间: 2009-11-17

我的可以啊,你执行
代码:
qmake-qt4 -project &&
qmake-qt4 &&
make

看看

作者: tusooa   发布时间: 2010-01-28

没有错误的!

作者: black_cx   发布时间: 2010-09-05

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的问题了

求助!!!
附件:
文件注释: qt源码,各位可以帮为看看除了什么问题
gotocell2.tar.gz [1.19 KiB]
被下载 6 次

作者: wangjun403   发布时间: 2009-11-09

我的情况跟你差不多啊。。
lee@lee-laptop:~/c$ make
/usr/bin/qmake-qt4 -unix -o Makefile c.pro
gcc -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. -o micro.o micro.c
micro.c: In function ‘main’:
micro.c:16: error: expected expression before ‘[’ token
micro.c:20: error: subscripted value is neither array nor pointer
micro.c:23: error: expected declaration or statement at end of input
micro.c:23: error: expected declaration or statement at end of input
make: *** [micro.o] 错误 1
好心人帮忙~

作者: liguanyao   发布时间: 2009-11-10

那是因为GoToCellDialog()这个函数你还没实现呢。
看下一章,就有了。

作者: sclzmbie   发布时间: 2009-11-13

我的是提示ld error:not find -lqt;

作者: md5xwl   发布时间: 2009-11-17

我的可以啊,你执行
代码:
qmake-qt4 -project &&
qmake-qt4 &&
make

看看

作者: tusooa   发布时间: 2010-01-28

没有错误的!

作者: black_cx   发布时间: 2010-09-05

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的问题了

求助!!!
附件:
文件注释: qt源码,各位可以帮为看看除了什么问题
gotocell2.tar.gz [1.19 KiB]
被下载 6 次

作者: wangjun403   发布时间: 2009-11-09

我的情况跟你差不多啊。。
lee@lee-laptop:~/c$ make
/usr/bin/qmake-qt4 -unix -o Makefile c.pro
gcc -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. -o micro.o micro.c
micro.c: In function ‘main’:
micro.c:16: error: expected expression before ‘[’ token
micro.c:20: error: subscripted value is neither array nor pointer
micro.c:23: error: expected declaration or statement at end of input
micro.c:23: error: expected declaration or statement at end of input
make: *** [micro.o] 错误 1
好心人帮忙~

作者: liguanyao   发布时间: 2009-11-10

那是因为GoToCellDialog()这个函数你还没实现呢。
看下一章,就有了。

作者: sclzmbie   发布时间: 2009-11-13

我的是提示ld error:not find -lqt;

作者: md5xwl   发布时间: 2009-11-17

我的可以啊,你执行
代码:
qmake-qt4 -project &&
qmake-qt4 &&
make

看看

作者: tusooa   发布时间: 2010-01-28

没有错误的!

作者: black_cx   发布时间: 2010-09-05