QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3294|回复: 6

编译QT时候出现错误

[复制链接]
发表于 2003-11-20 16:51:02 | 显示全部楼层 |阅读模式
我在编译一个较小的QT lib。但是我用-qconfig small后,使用qmake命令编译到qapplication_x11.o时候有错误,我用的是QT-2.3.2,哪位知道请告诉一声,谢谢。
发表于 2003-11-20 19:47:57 | 显示全部楼层
老兄,什么错误你也底贴出来才知道呀!
不过凭直觉是包含头文件顺序的事。
回复

使用道具 举报

发表于 2003-11-21 08:23:12 | 显示全部楼层
如果可以把code也贴出来!
回复

使用道具 举报

 楼主| 发表于 2003-11-21 08:53:47 | 显示全部楼层
我是在编译QT 的小型库的时候出现的错误
我的系统是RED HAT LINUX 9.0
在编译标准库的时候,(就是没有缩减的QT LIB),没有出现任何的错误
但是在使用config-small配置文件编译的时候,使用./configure -qconfig small通过,在make后不知道为什么,QT仍然编译很多的不相关的文件。但是没有错误,直到编译到qapplication的时候有问题。因为qt使用其他的头文件(如widgets),但是我已经声明不编译了(在config-small.h中定义了QT_NO_WIDGETS)。
回复

使用道具 举报

 楼主| 发表于 2003-11-21 10:21:43 | 显示全部楼层
提示信息如下:

g++  -c -I/usr/X11R6/include -I/usr/local/src/qt-2.3.2/include -I/usr/X11R6/include -pipe -O2 -Wall -W -fPIC -DQT_BUILTIN_GIF_READER=0 -DQT_NO_IMAGEIO_JPEG -DQT_NO_IMAGEIO_MNG -DQT_XFT  -I/usr/local/src/qt-2.3.2/src/3rdparty/zlib -I/usr/local/src/qt-2.3.2/src/3rdparty/libpng  -o kernel/qapplication_x11.o kernel/qapplication_x11.cpp
In file included from kernel/qt_x11.h:76,
                 from kernel/qapplication_x11.cpp:141:
/usr/X11R6/include/X11/Xft/Xft.h:35:31: freetype/freetype.h: 没有那个文件或目录
In file included from kernel/qt_x11.h:76,
                 from kernel/qapplication_x11.cpp:141:
/usr/X11R6/include/X11/Xft/Xft.h:52: syntax error before `;' token
/usr/X11R6/include/X11/Xft/Xft.h:86: 'FT_UInt' is used as a type, but is not
   defined as a type.
/usr/X11R6/include/X11/Xft/Xft.h:93: 'FT_UInt' is used as a type, but is not
   defined as a type.
/usr/X11R6/include/X11/Xft/Xft.h:190: parse error before `*' token
/usr/X11R6/include/X11/Xft/Xft.h:295: parse error before `*' token
/usr/X11R6/include/X11/Xft/Xft.h:354: parse error before `*' token
/usr/X11R6/include/X11/Xft/Xft.h:393: parse error before `*' token
/usr/X11R6/include/X11/Xft/Xft.h:399: parse error before `*' token
/usr/X11R6/include/X11/Xft/Xft.h:408: type specifier omitted for parameter `
   FT_UInt'
/usr/X11R6/include/X11/Xft/Xft.h:408: parse error before `,' token
/usr/X11R6/include/X11/Xft/Xft.h:418: parse error before `*' token
/usr/X11R6/include/X11/Xft/Xft.h:461: parse error before `*' token
kernel/qapplication_x11.cpp: In function `bool qt_set_desktop_properties()':
kernel/qapplication_x11.cpp:756: variable `QDataStream d' has initializer but
   incomplete type
kernel/qapplication_x11.cpp: In function `void qt_set_input_encoding()':
kernel/qapplication_x11.cpp:813: no method `QTextCodec::codecForLocale'
kernel/qapplication_x11.cpp:817: no method `QTextCodec::codecForLocale'
kernel/qapplication_x11.cpp:819: no method `QTextCodec::codecForName'
kernel/qapplication_x11.cpp:822: no method `QTextCodec::codecForName'
kernel/qapplication_x11.cpp:824: invalid use of undefined type `struct
   QTextCodec'
kernel/qfontmetrics.h:46: forward declaration of `struct QTextCodec'
kernel/qapplication_x11.cpp:825: no method `QTextCodec::codecForName'
kernel/qapplication_x11.cpp: In function `void qt_set_x11_resources(const
   char*, const char*, const char*, const char*)':
kernel/qapplication_x11.cpp:985: variable `QStringList effects' has initializer
   but incomplete type
kernel/qapplication_x11.cpp:985: no method `QStringList::split'
kernel/qapplication_x11.cpp: In member function `virtual int
   QApplication:11ClientMessage(QWidget*, XEvent*, bool)':
kernel/qapplication_x11.cpp:2761: `QWhatsThis' undeclared (first use this
   function)
kernel/qapplication_x11.cpp:2761: (Each undeclared identifier is reported only
   once for each function it appears in.)
kernel/qapplication_x11.cpp:2761: parse error before `::' token
kernel/qapplication_x11.cpp: In member function `int
   QApplication:11ProcessEvent(XEvent*)':
kernel/qapplication_x11.cpp:2880: invalid use of undefined type `struct
   QClipboard'
kernel/qwindowdefs.h:83: forward declaration of `struct QClipboard'
kernel/qapplication_x11.cpp:2882: invalid use of undefined type `struct
   QClipboard'
kernel/qwindowdefs.h:83: forward declaration of `struct QClipboard'
kernel/qapplication_x11.cpp: In member function `bool
   QETWidget::translateKeyEventInternal(const XEvent*, int&, QString&, int&,
   char&, int&)':
kernel/qapplication_x11.cpp:4453: no method `QTextCodec::codecForMib'
kernel/qapplication_x11.cpp:4488: invalid use of undefined type `struct
   QTextCodec'
kernel/qfontmetrics.h:46: forward declaration of `struct QTextCodec'
kernel/qapplication_x11.cpp:4561: invalid use of undefined type `struct
   QTextCodec'
kernel/qfontmetrics.h:46: forward declaration of `struct QTextCodec'
kernel/qapplication_x11.cpp: In function `void sm_setProperty(const QString&,
   const QStringList&)':
kernel/qapplication_x11.cpp:5358: invalid use of undefined type `struct
   QStringList'
kernel/qfont.h:47: forward declaration of `struct QStringList'
kernel/qapplication_x11.cpp:5360: incomplete type `QStringList' does not have
   member `ConstIterator'
kernel/qapplication_x11.cpp:5360: parse error before `=' token
kernel/qapplication_x11.cpp:5360: `it' undeclared (first use this function)
kernel/qapplication_x11.cpp:5360: invalid use of undefined type `struct
   QStringList'
kernel/qfont.h:47: forward declaration of `struct QStringList'
kernel/qapplication_x11.cpp: In function `void
   sm_performSaveYourself(QSessionManager*)':
kernel/qapplication_x11.cpp:5411: aggregate `QStringList restart' has
   incomplete type and cannot be defined
kernel/qapplication_x11.cpp:5412: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp:5414: aggregate `QStringList discard' has
   incomplete type and cannot be defined
kernel/qapplication_x11.cpp:5419: no matching function for call to `
   QApplication::commitData(QSessionManager&)'
kernel/qapplication_x11.cpp:5424: no matching function for call to `
   QApplication::saveState(QSessionManager&)'
kernel/qapplication_x11.cpp:5427: no matching function for call to `
   QApplication::commitData(QSessionManager&)'
kernel/qapplication_x11.cpp:5446: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp:5453: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp:5454: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp:5459: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp: At global scope:
kernel/qapplication_x11.cpp:5519: field `restartCommand' has incomplete type
kernel/qapplication_x11.cpp:5520: field `discardCommand' has incomplete type
kernel/qapplication_x11.cpp:5522: syntax error before `;' token
kernel/qapplication_x11.cpp:5517: destructor `QSessionManagerData' must match
   class name `QSessionManager'
kernel/qapplication_x11.cpp:5517: ISO C++ forbids declaration of `
   QSessionManagerData' with no type
kernel/qapplication_x11.cpp:5517: ISO C++ forbids declaration of `
   QSessionManagerData' with no type
kernel/qapplication_x11.cpp:5526: cannot declare member function `
   QSessionManager::QSessionManager' within `QSessionManagerData'
kernel/qapplication_x11.cpp:5526: syntax error before `:' token
kernel/qapplication_x11.cpp:5529: syntax error before `->' token
kernel/qapplication_x11.cpp:5530: syntax error before `->' token
kernel/qapplication_x11.cpp:5532: ISO C++ forbids declaration of `resetSmState'
   with no type
kernel/qapplication_x11.cpp:5532: new declaration `int resetSmState()'
kernel/qapplication_x11.cpp:5307: ambiguates old declaration `void
   resetSmState()'
kernel/qapplication_x11.cpp:5535: `session' was not declared in this scope
kernel/qapplication_x11.cpp:5538: syntax error before `.' token
kernel/qapplication_x11.cpp:5539: syntax error before `.' token
kernel/qapplication_x11.cpp:5540: syntax error before `.' token
kernel/qapplication_x11.cpp:5541: syntax error before `.' token
kernel/qapplication_x11.cpp:5542: syntax error before `.' token
kernel/qapplication_x11.cpp:5543: syntax error before `.' token
kernel/qapplication_x11.cpp:5544: syntax error before `.' token
kernel/qapplication_x11.cpp:5545: syntax error before `.' token
kernel/qapplication_x11.cpp:5550: parse error before `if'
kernel/qapplication_x11.cpp:5553: ISO C++ forbids declaration of `smcConnection
   ' with no type
kernel/qapplication_x11.cpp:5553: conflicting types for `int smcConnection'
kernel/qapplication_x11.cpp:5275: previous declaration as `
   _SmcConn*smcConnection'
kernel/qapplication_x11.cpp:5562: invalid conversion from `_SmcConn*' to `int'
kernel/qapplication_x11.cpp:5564: syntax error before `->' token
kernel/qapplication_x11.cpp:5565: ISO C++ forbids declaration of `free' with no
   type
kernel/qapplication_x11.cpp:5565: `int free' redeclared as different kind of
   symbol
/usr/include/stdlib.h:569: previous declaration of `void free(void*)'
kernel/qapplication_x11.cpp:5565: invalid conversion from `char*' to `int'
kernel/qapplication_x11.cpp:5566: ISO C++ forbids declaration of `session' with
   no type
kernel/qapplication_x11.cpp:5566: `d' was not declared in this scope
kernel/qapplication_x11.cpp:5569: parse error before `if'
kernel/qapplication_x11.cpp:5578: cannot declare member function `
   QSessionManager::QSessionManager' within `QSessionManagerData'
kernel/qapplication_x11.cpp:5578: syntax error before `{' token
kernel/qapplication_x11.cpp:5581: ISO C++ forbids declaration of `smcConnection
   ' with no type
kernel/qapplication_x11.cpp:5581: redefinition of `int smcConnection'
kernel/qapplication_x11.cpp:5553: `int smcConnection' previously defined here
kernel/qapplication_x11.cpp:5582: parse error before `delete'
kernel/qapplication_x11.cpp:5587: cannot declare member function `
   QSessionManager::sessionId' within `QSessionManagerData'
kernel/qapplication_x11.cpp:5587: syntax error before `{' token
kernel/qapplication_x11.cpp:5592: cannot declare member function `
   QSessionManager::handle' within `QSessionManagerData'
kernel/qapplication_x11.cpp:5592: syntax error before `{' token
kernel/qapplication_x11.cpp:5598: cannot declare member function `
   QSessionManager::allowsInteraction' within `QSessionManagerData'
kernel/qapplication_x11.cpp:5598: syntax error before `{' token
kernel/qapplication_x11.cpp:5611: ISO C++ forbids declaration of `
   sm_waitingForInteraction' with no type
kernel/qapplication_x11.cpp:5611: conflicting types for `int
   sm_waitingForInteraction'
kernel/qapplication_x11.cpp:5284: previous declaration as `bool
   sm_waitingForInteraction'
kernel/qapplication_x11.cpp:5612: parse error before `if'
kernel/qapplication_x11.cpp:5614: ISO C++ forbids declaration of `
   sm_blockUserInput' with no type
kernel/qapplication_x11.cpp:5614: conflicting types for `int sm_blockUserInput'
kernel/qapplication_x11.cpp:335: previous declaration as `bool
   sm_blockUserInput'
kernel/qapplication_x11.cpp:5615: parse error before `return'
kernel/qapplication_x11.cpp:5622: cannot declare member function `
   QSessionManager::allowsErrorInteraction' within `QSessionManagerData'
kernel/qapplication_x11.cpp:5622: syntax error before `{' token
kernel/qapplication_x11.cpp:5635: ISO C++ forbids declaration of `
   sm_waitingForInteraction' with no type
kernel/qapplication_x11.cpp:5635: redefinition of `int sm_waitingForInteraction
   '
kernel/qapplication_x11.cpp:5611: `int sm_waitingForInteraction' previously
   defined here
kernel/qapplication_x11.cpp:5636: parse error before `if'
kernel/qapplication_x11.cpp:5638: ISO C++ forbids declaration of `
   sm_blockUserInput' with no type
kernel/qapplication_x11.cpp:5638: redefinition of `int sm_blockUserInput'
kernel/qapplication_x11.cpp:5614: `int sm_blockUserInput' previously defined
   here
kernel/qapplication_x11.cpp:5639: parse error before `return'
kernel/qapplication_x11.cpp:5646: cannot declare member function `
   QSessionManager::release' within `QSessionManagerData'
kernel/qapplication_x11.cpp:5646: syntax error before `{' token
kernel/qapplication_x11.cpp:5649: ISO C++ forbids declaration of `
   sm_interactionActive' with no type
kernel/qapplication_x11.cpp:5649: conflicting types for `int
   sm_interactionActive'
kernel/qapplication_x11.cpp:5276: previous declaration as `bool
   sm_interactionActive'
kernel/qapplication_x11.cpp:5650: parse error before `if'
kernel/qapplication_x11.cpp:5656: cannot declare member function `
   QSessionManager::cancel' within `QSessionManagerData'
kernel/qapplication_x11.cpp:5656: syntax error before `{' token
kernel/qapplication_x11.cpp:5660: incomplete type `QSessionManager' does not
   have member `RestartHint'
kernel/qapplication_x11.cpp:5660: parse error before `)' token
kernel/qapplication_x11.cpp:5661: cannot declare member function `
   QSessionManager::setRestartHint' within `QSessionManagerData'
kernel/qapplication_x11.cpp:5661: syntax error before `{' token
kernel/qapplication_x11.cpp:5665: syntax error before `::' token
kernel/qapplication_x11.cpp:5671: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp: In member function `void
   QSessionManager::setRestartCommand(const QStringList&)':
kernel/qapplication_x11.cpp:5672: `d' undeclared (first use this function)
kernel/qapplication_x11.cpp: At global scope:
kernel/qapplication_x11.cpp:5676: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp: In member function `QStringList
   QSessionManager::restartCommand() const':
kernel/qapplication_x11.cpp:5676: return type `struct QStringList' is
   incomplete
kernel/qapplication_x11.cpp: At global scope:
kernel/qapplication_x11.cpp:5681: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp:5686: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp: In member function `QStringList
   QSessionManager::discardCommand() const':
kernel/qapplication_x11.cpp:5686: return type `struct QStringList' is
   incomplete
kernel/qapplication_x11.cpp: At global scope:
kernel/qapplication_x11.cpp:5691: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp: In member function `void
   QSessionManager::setProperty(const QString&, const QString&)':
kernel/qapplication_x11.cpp:5694: no matching function for call to `QString::
   utf8() const'
kernel/qapplication_x11.cpp: At global scope:
kernel/qapplication_x11.cpp:5699: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp: In member function `void
   QSessionManager::setProperty(const QString&, const QStringList&)':
kernel/qapplication_x11.cpp:5700: invalid use of undefined type `struct
   QStringList'
kernel/qfont.h:47: forward declaration of `struct QStringList'
kernel/qapplication_x11.cpp:5702: incomplete type `QStringList' does not have
   member `ConstIterator'
kernel/qapplication_x11.cpp:5702: parse error before `=' token
kernel/qapplication_x11.cpp:5702: invalid use of undefined type `struct
   QStringList'
kernel/qfont.h:47: forward declaration of `struct QStringList'
kernel/qapplication_x11.cpp: At global scope:
kernel/qapplication_x11.cpp:5712: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
kernel/qapplication_x11.cpp:5717: invalid use of undefined type `struct
   QSessionManager'
kernel/qapplication.h:48: forward declaration of `struct QSessionManager'
{standard input}: Assembler messages:
{standard input}:617: Error: symbol `smcConnection' is already defined
{standard input}:623: Error: symbol `sm_waitingForInteraction' is already defined
{standard input}:629: Error: symbol `sm_blockUserInput' is already defined
make[2]: *** [kernel/qapplication_x11.o] Error 1
make[2]: Leaving directory `/usr/local/src/qt-2.3.2/src'
make[1]: *** [sub-src] Error 2
make[1]: Leaving directory `/usr/local/src/qt-2.3.2'
make: *** [init] Error 2
回复

使用道具 举报

发表于 2003-11-21 22:42:58 | 显示全部楼层
大哥code呢·一起贴出来啥
回复

使用道具 举报

 楼主| 发表于 2003-11-24 08:40:24 | 显示全部楼层
#define NO_CHECK
#ifndef QT_H
#endif // QT_H

#if !defined(QT_NO_QWS_DEPTH_16) ||  !defined(QT_NO_QWS_DEPTH_ || !defined(QT_NO_QWS_DEPTH_32) || !defined(QT_NO_QWS_VGA_16)  
//We only need 1-bit support if we have a 1-bit screen
#define QT_NO_QWS_DEPTH_1
#endif


#define QT_NO_ACTION
#ifndef QT_NO_CODECS // moc?
#define QT_NO_TEXTCODEC
#endif
#define QT_NO_UNICODETABLES
#define QT_NO_IMAGEIO_BMP
#define QT_NO_IMAGEIO_PPM
#define QT_NO_IMAGEIO_XBM
#define QT_NO_IMAGEIO_XPM
#define QT_NO_IMAGEIO_PNG
#define QT_NO_ASYNC_IO
#define QT_NO_ASYNC_IMAGE_IO
#define QT_NO_FREETYPE
#define QT_NO_BDF
#define QT_NO_FONTDATABASE
#define QT_NO_TRANSLATION
#define QT_NO_MIME
#define QT_NO_SOUND
#define QT_NO_PROPERTIES

#define QT_NO_QWS_GFX_SPEED
#define QT_NO_NETWORK //??????????????
#define QT_NO_COLORNAMES
#define QT_NO_TRANSFORMATIONS
#define QT_NO_PRINTER
#define QT_NO_PICTURE

#define QT_NO_IMAGE_TRUECOLOR
//#define QT_NO_IMAGE_SMOOTHSCALE  //needed for iconset --> pushbutton
#define QT_NO_IMAGE_TEXT
#define QT_NO_DIR

#define QT_NO_TEXTSTREAM
#define QT_NO_DATASTREAM
#define QT_NO_QWS_SAVEFONTS
#define QT_NO_STRINGLIST
#define QT_NO_SESSIONMANAGER


#define QT_NO_DIALOG

#define QT_NO_SEMIMODAL

//#define QT_NO_STYLE //will require substantial work...

#define QT_NO_EFFECTS
#define QT_NO_COP

#define QT_NO_QWS_PROPERTIES

#define QT_NO_RANGECONTROL
#define QT_NO_SPLITTER
#define QT_NO_STATUSBAR
#define QT_NO_TABBAR
#define QT_NO_TOOLBAR
#define QT_NO_TOOLTIP
#define QT_NO_VALIDATOR
#define QT_NO_WHATSTHIS
#define QT_NO_WIDGETSTACK
#define QT_NO_ACCEL
#define QT_NO_SIZEGRIP
#define QT_NO_HEADER
#define QT_NO_WORKSPACE
#define QT_NO_LCDNUMBER
#define QT_NO_STYLE_MOTIF
#define QT_NO_STYLE_PLATINUM
#define QT_NO_PROGRESSBAR


#define QT_NO_QWS_HYDRO_WM_STYLE
#define QT_NO_QWS_BEOS_WM_STYLE
#define QT_NO_QWS_KDE2_WM_STYLE
#define QT_NO_QWS_KDE_WM_STYLE
//#define QT_NO_QWS_QPE_WM_STYLE
#define QT_NO_QWS_WINDOWS_WM_STYLE


//other widgets that could be removed:
//#define QT_NO_MENUDATA


//possible options:

//#define QT_NO_CURSOR
//#define QT_NO_LAYOUT
//#define QT_NO_QWS_MANAGER
//#define QT_NO_QWS_KEYBOARD
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-9 10:41 , Processed in 0.037800 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表