• 8179阅读
  • 1回复

【提问】请教一个qt程序的编译问题 [复制链接]

上一主题 下一主题
离线baker0611
 

只看楼主 倒序阅读 楼主  发表于: 2006-03-16
【提问】请教一个qt程序的编译问题
#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
  QApplication app(argc, argv);

  QPushButton hello("Hello world!");
  hello.resize(100, 30);

  hello.show();
  return app.exec();
}
在dev-c++中编译的:
[Linker error] undefined reference to `_imp___ZN12QApplicationC1ERiPPc'
[Linker error] undefined reference to `_imp___ZN11QPushButtonC1ERK7QStringP7QWidget'
[Linker error] undefined reference to `_imp___ZN12QApplication4execEv'
一串类似的错误提示,我搞了半天也不知道是哪里的问题。
离线XChinux

只看该作者 1楼 发表于: 2006-03-16
不要在DevCpp中编译,要想用它编译,需要设置许多东西的。头文件,库,编译方式等。
用Qt Command Prompt编译。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
快速回复
限100 字节
 
上一个 下一个