我试图用以下配置在我的机器中构建kdiff3-0.9.97
Linux 2.6.18-274.el5 #1 SMP Fri Jul 8 17:36:59 EDT 2011 x86_64 x86_64 x86_64 GNU/LinuxRed Hat Enterprise Linux Server release 5.7 (Tikanga)

[root@xxxx releaseQt]# /usr/lib64/qt4/bin/qmake -v
QMake version 2.01a
Using Qt version 4.2.1 in /usr/lib64/qt4/lib64

我试着犯下以下错误。
[root@xxxxxx releaseQt]# make
g++ -c -include kdiff3 -m64 -pipe -O2 -D_REENTRANT -Wall -W  -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++-64 -I../src-QT4 -/usr/lib64/qt4/include/QtCore -I/usr/lib64/qt4/include/QtCore -I/usr/lib64/qt4/include/QtGui -I/usr/lib64/qt4/include/QtGui -I/usr/lib64/qt4/include -I../src-QT4 -I../src-QT4/kreplacements -I../src-QT4 -I../src-QT4 -I. -o main.o ../src-QT4/main.cpp
In file included from ../src-QT4/kreplacements/kcmdlineargs.h:1,
from ../src-QT4/main.cpp:18:
../src-QT4/kreplacements/kreplacements.h:35:40: error: QExplicitlySharedDataPointer: No
../src-QT4/kreplacements/kreplacements.h:288: error: ISO C++ forbids declaration of âQEx
../src-QT4/kreplacements/kreplacements.h:288: error: expected â;â before â<â token
../src-QT4/kreplacements/kreplacements.h: In member function âvoid KConfigGroup::writeEn
../src-QT4/kreplacements/kreplacements.h:298: error: âdâ was not declared in this scope
../src-QT4/kreplacements/kreplacements.h: In member function âvoid KConfigGroup::writeEn:
../src-QT4/kreplacements/kreplacements.h:299: error: âdâ was not declared in this scope
../src-QT4/kreplacements/kreplacements.h: In member function âvoid KConfigGroup::writeEn
../src-QT4/kreplacements/kreplacements.h:300: error: âdâ was not declared in this scope
../src-QT4/kreplacements/kreplacements.h: In member function âT KConfigGroup::readEntry(
../src-QT4/kreplacements/kreplacements.h:302: error: âdâ was not declared in this scope
../src-QT4/kreplacements/kreplacements.h: In member function âQString KConfigGroup::read
../src-QT4/kreplacements/kreplacements.h:303: error: âdâ was not declared in this scope
../src-QT4/kreplacements/kreplacements.h: In member function âQStringList KConfigGroup::char)â:
../src-QT4/kreplacements/kreplacements.h:304: error: âdâ was not declared in this scope

我试过用谷歌搜索,但上面提到的答案都不起作用

最佳答案

上面提到你需要Qt4.4.0或更高版本,你有4.2.1
README Requirements and Installation部分:
要求和安装
对于KDE4:
KDiff3上的0.9.93版本支持KDE4。
对于大多数发行版的安装,通常还需要这些包(opensuse上的名称):
g++(g++,3.4版或更新版本)
libqt4-devel(Qt4-libs,4.4.0或更新版本)
libkde4 devel(KDE4头文件和开发库)
libkonq devel(可选,kdiff3插件需要,如果未安装
则不会为konqueror构建contextmenu插件。)
cmake(>2.6,检查依赖项并为系统创建指定的Makefiles)

关于c++ - 关于/kreplacements/kreplacements.h的错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20684695/

10-08 21:21