• 14639阅读
  • 11回复

vs2005 编译 qt-win-commercial-src-4.3.0出错 [复制链接]

上一主题 下一主题
离线hadrons
 

只看楼主 倒序阅读 楼主  发表于: 2007-08-06
— 本帖被 XChinux 执行加亮操作(2007-08-12) —
编译qt-win-commercial-src-4.3.0,编译器vs2005
configure 顺利
nmake时,winmain moc uic rcc corelib xml成功,在编译gui库时出错,信息如下:

      cl -c -FIqt_gui_pch.h -Yuqt_gui_pch.h -Fptmp\obj\debug_shared\QtGuid_pch
.pch -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -W3 -w34100 -w34189 -GR -EHsc -DQT_SHA
RED -DQT_THREAD_SUPPORT -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_EDITION=QT
_EDITION_DESKTOP -DQT_BUILD_GUI_LIB -DQT_MAKEDLL -DQT_NO_CAST_TO_ASCII -DQT_ASCI
I_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -D_USE_MATH_DEFINES -DQT_RASTER_IM
AGEENGINE -DQT_RASTER_PAINTENGINE -DQT_NO_CUPS -DQT_NO_LPR -DQT_HAVE_MMX -DQT_HA
VE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_SSE2 -DQT_NO_FREETYPE -DQT_NO_OPENTYPE -DQT_NO_
STYLE_MAC -DQ_INTERNAL_QAPP_SRC -DQT_DLL -DQT_CORE_LIB -I"..\..\include\QtCore"
-I"..\..\include\QtCore" -I"..\..\include" -I"..\..\include\QtGui" -I"tmp" -I"..
\3rdparty\wintab" -I"..\3rdparty\libpng" -I"..\3rdparty\zlib" -I"dialogs" -I"..\
..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"." -I"..\..\mkspecs\win32-msvc2
005" -Fotmp\obj\debug_shared\ @C:\DOCUME~1\H2D82~1.WAN\LOCALS~1\Temp\nmEC.tmp
moc_qwizard_win_p.cpp
tmp\moc\debug_shared\moc_qwizard_win_p.cpp(36) : error C2653: “QVistaHelper”:
不是类或命名空间名称
tmp\moc\debug_shared\moc_qwizard_win_p.cpp(41) : error C2653: “QVistaHelper”:
不是类或命名空间名称
tmp\moc\debug_shared\moc_qwizard_win_p.cpp(42) : error C2270: “metaObject”: 非
成员函数上不允许修饰符
tmp\moc\debug_shared\moc_qwizard_win_p.cpp(46) : error C2653: “QVistaHelper”:
不是类或命名空间名称
tmp\moc\debug_shared\moc_qwizard_win_p.cpp(50) : error C2061: 语法错误 : 标识符
“QVistaHelper”
tmp\moc\debug_shared\moc_qwizard_win_p.cpp(50) : error C2146: 语法错误 : 缺少“(
”(在标识符“QVistaHelper”的前面)
tmp\moc\debug_shared\moc_qwizard_win_p.cpp(51) : error C2352: “QObject::qt_meta
cast”: 非静态成员函数的非法调用
        c:\qt\4.3.0\include\qtcore\../../src/corelib/kernel/qobject.h(92) : 参见
“QObject::qt_metacast”的声明
tmp\moc\debug_shared\moc_qwizard_win_p.cpp(54) : error C2653: “QVistaHelper”:
不是类或命名空间名称
tmp\moc\debug_shared\moc_qwizard_win_p.cpp(56) : error C2352: “QObject::qt_meta
call”: 非静态成员函数的非法调用
        c:\qt\4.3.0\include\qtcore\../../src/corelib/kernel/qobject.h(92) : 参见
“QObject::qt_metacall”的声明
NMAKE : fatal error U1077: “"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\
cl.EXE"”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\
nmake.exe"”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “cd”: 返回代码“0x2”
Stop.

我对出错信息很是疑惑,QVistaHelper命名存在的,怎么不认识啊?
[ 此贴被XChinux在2007-08-12 22:32重新编辑 ]
离线hadrons

只看该作者 1楼 发表于: 2007-08-06
这是QVistaHelper头文件
/****************************************************************************
**
** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** Licensees holding a valid Qt License Agreement may use this file in
** accordance with the rights, responsibilities and obligations
** contained therein.  Please consult your licensing agreement or
** contact sales@trolltech.com if any conditions of this licensing
** agreement are not clear to you.
**
** Further information about Qt licensing is available at:
** http://www.trolltech.com/products/qt/licensing.html or by
** contacting info@trolltech.com.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/

#ifndef QWIZARD_WIN_P_H
#define QWIZARD_WIN_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#ifndef QT_NO_WIZARD
#ifndef QT_NO_STYLE_WINDOWSVISTA

#include <windows.h>
#include <qobject.h>
#include <qwidget.h>
#include <qabstractbutton.h>
#include <QtGui/private/qwidget_p.h>

class QVistaBackButton : public QAbstractButton
{
public:
    QVistaBackButton(QWidget *widget);

    QSize sizeHint() const;
    inline QSize minimumSizeHint() const
    { return sizeHint(); }

    void enterEvent(QEvent *event);
    void leaveEvent(QEvent *event);
    void paintEvent(QPaintEvent *event);
};

class QWizard;

class QVistaHelper : public QObject
{
    Q_OBJECT
public:
    QVistaHelper(QWizard *wizard);
    ~QVistaHelper();
    enum TitleBarChangeType { NormalTitleBar, ExtendedTitleBar };
    bool setDWMTitleBar(TitleBarChangeType type);
    void mouseEvent(QEvent *event);
    bool handleWinEvent(MSG *message, long *result);
    void resizeEvent(QResizeEvent *event);
    void paintEvent(QPaintEvent *event);
    QVistaBackButton *backButton() const { return backButton_; }
    void setWindowPosHack();
    static bool isCompositionEnabled();
    static bool isVista();

    static int titleBarSize() { return frameSize() + captionSize(); }

    static int topPadding() { return 8; } // standard Aero (?)

    static int topOffset() { return titleBarSize() + 13; } // standard Aero

private:
    static HFONT getCaptionFont(HANDLE hTheme);
    static bool drawTitleText(const QString &text, const QRect &rect, HDC hdc);
    static bool drawBlackRect(const QRect &rect, HDC hdc);

    static int frameSize() { return GetSystemMetrics(SM_CYSIZEFRAME); }
    static int captionSize() { return GetSystemMetrics(SM_CYCAPTION); }

    static int backButtonSize() { return 31; } // ### should be queried from back button itself
    static int iconSize() { return 16; } // Standard Aero
    static int padding() { return 7; } // Standard Aero
    static int leftMargin() { return backButtonSize() + padding(); }
    static int glowSize() { return 10; }

    int titleOffset();
    bool resolveSymbols();
    void drawTitleBar(QPainter *painter);
    void setMouseCursor(QPoint pos);
    void collapseTopFrameStrut();
    bool winEvent(MSG *message, long *result);
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    bool eventFilter(QObject *obj, QEvent *event);

    static bool is_vista;
    enum Changes { resizeTop, movePosition, noChange } change;
    QPoint pressedPos;
    bool pressed;
    QRect rtTop;
    QRect rtTitle;
    QWizard *wizard;
    QVistaBackButton *backButton_;
};

#endif // QT_NO_STYLE_WINDOWSXP
#endif // QT_NO_WIZARD

#endif // QWIZARD_WIN_P_H
离线hadrons

只看该作者 2楼 发表于: 2007-08-06
这是出错的文件moc_qwizard_win_p.cpp。

/****************************************************************************
** Meta object code from reading C++ file 'qwizard_win_p.h'
**
** Created: Mon Aug 6 02:16:01 2007
**      by: The Qt Meta Object Compiler version 59 (Qt 4.3.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#include "../../../dialogs/qwizard_win_p.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'qwizard_win_p.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 59
#error "This file was generated using the moc from 4.3.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif

static const uint qt_meta_data_QVistaHelper[] = {

// content:
      1,      // revision
      0,      // classname
      0,    0, // classinfo
      0,    0, // methods
      0,    0, // properties
      0,    0, // enums/sets

      0        // eod
};

static const char qt_meta_stringdata_QVistaHelper[] = {
    "QVistaHelper\0"
};

const QMetaObject QVistaHelper::staticMetaObject = {
    { &QObject::staticMetaObject, qt_meta_stringdata_QVistaHelper,
      qt_meta_data_QVistaHelper, 0 }
};

const QMetaObject *QVistaHelper::metaObject() const
{
    return &staticMetaObject;
}

void *QVistaHelper::qt_metacast(const char *_clname)
{
    if (!_clname) return 0;
    if (!strcmp(_clname, qt_meta_stringdata_QVistaHelper))
    return static_cast<void*>(const_cast< QVistaHelper*>(this));
    return QObject::qt_metacast(_clname);
}

int QVistaHelper::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    return _id;
}
离线hadrons

只看该作者 3楼 发表于: 2007-08-06
已解决,QT bug
在控制台QT目录下: del /s qconfig.h
离线norton2008
只看该作者 4楼 发表于: 2007-08-06
请问src编译完以后和troll给得编译好得安装文件一样吗?编译commercial-src得时候需要有许可吗?
离线hadrons

只看该作者 5楼 发表于: 2007-08-07
没有进行过比较。

需要许可。
离线hadrons

只看该作者 6楼 发表于: 2007-08-07
没有进行过比较。

需要许可。
离线dinghwy

只看该作者 7楼 发表于: 2007-08-24
编译用了多久?硬盘需要多大空间?lisence怎么导入?
离线liujianboy
只看该作者 8楼 发表于: 2007-09-30
自己编译的版本比官方的编译版大了很多,太不爽了
离线千年沉寂

只看该作者 9楼 发表于: 2007-09-30
可以把编译产生的中间文件删除,整理完以后差不多是300MB左右
上善若水!
离线千年沉寂

只看该作者 10楼 发表于: 2007-09-30
编译大概要量个多小时,编译完以后差不多有1.5GB
上善若水!
离线2655268hp
只看该作者 11楼 发表于: 2008-01-16
回复 dinghwy  的话

编译用了多久?(1个多小时)硬盘需要多大空间?(开始要2G左右,编译好后用nmake clean 清除垃圾文件就只有不到400MB了)lisence怎么导入(把 .LICENSE 文件复制到系统盘的用户目录下
如C:\Documents and Settings\Administrator)?
快速回复
限100 字节
 
上一个 下一个