• 9956阅读
  • 2回复

qt-win-commercial-3.3.4+vs2003.net 编译程序出错 [复制链接]

上一主题 下一主题
离线zl198183
 

只看楼主 倒序阅读 楼主  发表于: 2008-02-22
qt-win-commercial-3.3.4+vs2003.net 编译程序出错
— 本帖被 XChinux 执行加亮操作(2008-02-24) —
错误日志如下:

生成日志      ------- 已启动生成: 项目: test,配置: Debug|Win32 -------

命令行      正在创建临时文件“c:\tmp\RSP000006.rsp”,其内容为
[
/O1 /I "C:\Qt\3.3.4\include" /I "." /I "C:\Qt\3.3.4\mkspecs\win32-msvc.net" /D "_WINDOWS" /D "UNICODE" /D "WIN32" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Gm /MD /Fo"Debug\\" /Fd".\\" /W3 /c /Zi /TP  -Zm200 -w34100 -w34189
.\main.cpp
]
正在创建命令行“cl.exe @c:\tmp\RSP000006.rsp /nologo”
正在创建临时文件“c:\tmp\RSP000007.rsp”,其内容为
[
/OUT:"Debug\\test.exe" /NOLOGO /LIBPATH:"C:\Qt\3.3.4\lib" /DEBUG /SUBSYSTEM:WINDOWS qt-mt334.lib qtmain.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
.\Debug\main.obj
.\Debug\mydialog.obj
]
正在创建命令行“link.exe @c:\tmp\RSP000007.rsp”
输出窗口      正在编译...
main.cpp
正在链接...
mydialog.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall MyDialog::qt_property(int,int,class QVariant *)" (?qt_property@MyDialog@@UAE_NHHPAVQVariant@@@Z)
mydialog.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall MyDialog::qt_emit(int,struct QUObject *)" (?qt_emit@MyDialog@@UAE_NHPAUQUObject@@@Z)
mydialog.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall MyDialog::qt_invoke(int,struct QUObject *)" (?qt_invoke@MyDialog@@UAE_NHPAUQUObject@@@Z)
mydialog.obj : error LNK2001: 无法解析的外部符号 "public: virtual void * __thiscall MyDialog::qt_cast(char const *)" (?qt_cast@MyDialog@@UAEPAXPBD@Z)
mydialog.obj : error LNK2001: 无法解析的外部符号 "public: virtual char const * __thiscall MyDialog::className(void)const " (?className@MyDialog@@UBEPBDXZ)
mydialog.obj : error LNK2019: 无法解析的外部符号 "public: static class QMetaObject * __cdecl MyDialog::staticMetaObject(void)" (?staticMetaObject@MyDialog@@SAPAVQMetaObject@@XZ) ,该符号在函数 "public: virtual class QMetaObject * __thiscall MyDialog::metaObject(void)const " (?metaObject@MyDialog@@UBEPAVQMetaObject@@XZ) 中被引用
mydialog.obj : error LNK2019: 无法解析的外部符号 "public: static class QString __cdecl MyDialog::tr(char const *,char const *)" (?tr@MyDialog@@SA?AVQString@@PBD0@Z) ,该符号在函数 "protected: virtual void __thiscall MyDialog::languageChange(void)" (?languageChange@MyDialog@@MAEXXZ) 中被引用
Debug\\test.exe : fatal error LNK1120: 7 个无法解析的外部命令
结果      生成日志保存在“file://e:\vc\test\Debug\\BuildLog.htm”中
test - 8 错误,0 警告

环境变量如下:
系统变量
INCLUDE=%NET2003%\SDK\v1.1\include\;%NET2003%\Vc7\include\;%NET2003%\Vc7\PlatformSDK\include\;%NET2003%\Vc7\atlmfc\include\
Lib=%NET2003%\SDK\v1.1\Lib\
NET2003=C:\Program Files\Microsoft Visual Studio .NET 2003
Path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%NET2003%\Common7\IDE;%NET2003%\Bin;%NET2003%\Common7\Tools;%NET2003%\Common7\Tools\bin\prerelease;%NET2003%\Common7\Tools\bin;%NET2003%\SDK\v1.1\bin;%NET2003%\SDK\v1.1\v1.1.4322;%NET2003%\Vc7\bin


用户变量
PATH=d:\Qtwin\3.3.4\bin;D:\Qtwin\3.3.4\bin;C:\Qtwin\3.3.4\bin

用户变量 = def
INCLUDE=%NET2003%\SDK\v1.1\include\;%NET2003%\Vc7\include\;%NET2003%\Vc7\PlatformSDK\include\;%NET2003%\Vc7\atlmfc\include\;%NET2003%\vc7\include\

用户变量
Lib=%NET2003%\Vc7\PlatformSDK\Lib\;%NET2003%\Vc7\lib\;%NET2003%\Vc7\atlmfc\lib\;%NET2003%\SDK\v1.1\Lib\
几个文件的代码如下:

main.cpp

  1. #include <qapplication.h>
  2. #include "mydialog.h"
  3. int main( int argc, char ** argv )
  4. {
  5.     QApplication a( argc, argv );
  6.     MyDialog w;
  7.     w.show(); 
  8.     return a.exec();
  9. }

mydialog.cpp
  1. /****************************************************************************
  2. ** Form implementation generated from reading ui file 'mydialog.ui'
  3. **
  4. ** Created: 星期五 二月 22 20:52:02 2008
  5. **      by: The User Interface Compiler ($Id: qt/main.cpp  3.3.4  edited Nov 24 2003 $)
  6. **
  7. ** WARNING! All changes made in this file will be lost!
  8. ****************************************************************************/
  9. #include "mydialog.h"
  10. #include <qvariant.h>
  11. #include <qpushbutton.h>
  12. #include <qradiobutton.h>
  13. #include <qlabel.h>
  14. #include <qcheckbox.h>
  15. #include <qlineedit.h>
  16. #include <qlayout.h>
  17. #include <qtooltip.h>
  18. #include <qwhatsthis.h>
  19. #include <qimage.h>
  20. #include <qpixmap.h>
  21. /*
  22. *  Constructs a MyDialog as a child of 'parent', with the
  23. *  name 'name' and widget flags set to 'f'.
  24. *
  25. *  The dialog will by default be modeless, unless you set 'modal' to
  26. *  TRUE to construct a modal dialog.
  27. */
  28. MyDialog::MyDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
  29.     : QDialog( parent, name, modal, fl )
  30. {
  31.     if ( !name )
  32.     setName( "MyDialog" );
  33.     setSizeGripEnabled( TRUE );
  34.     QWidget* privateLayoutWidget = new QWidget( this, "layout4" );
  35.     privateLayoutWidget->setGeometry( QRect( 80, 110, 365, 56 ) );
  36.     layout4 = new QVBoxLayout( privateLayoutWidget, 11, 6, "layout4");
  37.     layout2 = new QHBoxLayout( 0, 0, 6, "layout2");
  38.     radioButton1 = new QRadioButton( privateLayoutWidget, "radioButton1" );
  39.     layout2->addWidget( radioButton1 );
  40.     textLabel1 = new QLabel( privateLayoutWidget, "textLabel1" );
  41.     layout2->addWidget( textLabel1 );
  42.     checkBox1 = new QCheckBox( privateLayoutWidget, "checkBox1" );
  43.     layout2->addWidget( checkBox1 );
  44.     lineEdit1 = new QLineEdit( privateLayoutWidget, "lineEdit1" );
  45.     lineEdit1->setFrameShape( QLineEdit::LineEditPanel );
  46.     lineEdit1->setFrameShadow( QLineEdit::Sunken );
  47.     layout2->addWidget( lineEdit1 );
  48.     layout4->addLayout( layout2 );
  49.     Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
  50.     buttonHelp = new QPushButton( privateLayoutWidget, "buttonHelp" );
  51.     buttonHelp->setAutoDefault( TRUE );
  52.     Layout1->addWidget( buttonHelp );
  53.     Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
  54.     Layout1->addItem( Horizontal_Spacing2 );
  55.     buttonOk = new QPushButton( privateLayoutWidget, "buttonOk" );
  56.     buttonOk->setAutoDefault( TRUE );
  57.     buttonOk->setDefault( TRUE );
  58.     Layout1->addWidget( buttonOk );
  59.     buttonCancel = new QPushButton( privateLayoutWidget, "buttonCancel" );
  60.     buttonCancel->setAutoDefault( TRUE );
  61.     Layout1->addWidget( buttonCancel );
  62.     layout4->addLayout( Layout1 );
  63.     languageChange();
  64.     resize( QSize(511, 282).expandedTo(minimumSizeHint()) );
  65.     clearWState( WState_Polished );
  66.     // signals and slots connections
  67.     connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
  68.     connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
  69. }
  70. /*
  71. *  Destroys the object and frees any allocated resources
  72. */
  73. MyDialog::~MyDialog()
  74. {
  75.     // no need to delete child widgets, Qt does it all for us
  76. }
  77. /*
  78. *  Sets the strings of the subwidgets using the current
  79. *  language.
  80. */
  81. void MyDialog::languageChange()
  82. {
  83.     setCaption( tr( "MyDialog" ) );
  84.     radioButton1->setText( tr( "radioButton1" ) );
  85.     textLabel1->setText( tr( "textLabel1" ) );
  86.     checkBox1->setText( tr( "checkBox1" ) );
  87.     buttonHelp->setText( tr( "&Help" ) );
  88.     buttonHelp->setAccel( QKeySequence( tr( "F1" ) ) );
  89.     buttonOk->setText( tr( "&OK" ) );
  90.     buttonOk->setAccel( QKeySequence( QString::null ) );
  91.     buttonCancel->setText( tr( "&Cancel" ) );
  92.     buttonCancel->setAccel( QKeySequence( QString::null ) );
  93. }

mydialog.h
  1. /****************************************************************************
  2. ** Form interface generated from reading ui file 'mydialog.ui'
  3. **
  4. ** Created: 星期五 二月 22 19:26:36 2008
  5. **      by: The User Interface Compiler ($Id: qt/main.cpp  3.3.4  edited Nov 24 2003 $)
  6. **
  7. ** WARNING! All changes made in this file will be lost!
  8. ****************************************************************************/
  9. #ifndef MYDIALOG_H
  10. #define MYDIALOG_H
  11. #include <qvariant.h>
  12. #include <qdialog.h>
  13. class QVBoxLayout;
  14. class QHBoxLayout;
  15. class QGridLayout;
  16. class QSpacerItem;
  17. class QRadioButton;
  18. class QLabel;
  19. class QCheckBox;
  20. class QLineEdit;
  21. class QPushButton;
  22. class MyDialog : public QDialog
  23. {
  24.     Q_OBJECT
  25. public:
  26.     MyDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
  27.     ~MyDialog();
  28.     QRadioButton* radioButton1;
  29.     QLabel* textLabel1;
  30.     QCheckBox* checkBox1;
  31.     QLineEdit* lineEdit1;
  32.     QPushButton* buttonHelp;
  33.     QPushButton* buttonOk;
  34.     QPushButton* buttonCancel;
  35. protected:
  36.     QVBoxLayout* layout4;
  37.     QHBoxLayout* layout2;
  38.     QHBoxLayout* Layout1;
  39.     QSpacerItem* Horizontal_Spacing2;
  40. protected slots:
  41.     virtual void languageChange();
  42. };
  43. #endif // MYDIALOG_H
离线浪漫天使
只看该作者 1楼 发表于: 2008-02-24
没有moc_*.cpp那个文件
离线kingshare

只看该作者 2楼 发表于: 2008-03-26
兄弟们,发我 一个QTWIN3的包,我要用它来编译一个程序。email:kingsharex@163.com.先谢谢了。
快速回复
限100 字节
 
上一个 下一个