我试图在Ubuntu16.10版本5.24.1上安装QtCore4:
sudo apt-get install cmake
sudo apt-get install qt4-designer libqtgui4-perl
cpan -g QtCore4
bunzip2 Qt4-0.99.0.tar.bz2
tar xvf Qt4-0.99.0.tar
cd Qt4-0.99.0
perl Makefile.PL
make VERBOSE=1在这里,make在错误消息中失败:
Building CXX object smokeqt/qtdbus/CMakeFiles/smokeqtdbus.dir/x_1.cpp.o
cd /home/hakon/Qt4-0.99.0/smokeqt/qtdbus
/usr/bin/c++ -DSMOKE_BUILDING -Dsmokeqtdbus_EXPORTS \
-I/usr/include/qt4/QtDesigner \
-I/usr/include/qt4/QtDeclarative \
-I/usr/include/qt4/QtScriptTools \
-I/usr/include/qt4/QtDBus \
-I/usr/include/qt4/QtXml \
-I/usr/include/qt4/QtSql \
-I/usr/include/qt4/QtOpenGL \
-I/usr/include/qt4/QtNetwork \
-I/usr/include/qt4/QtXmlPatterns \
-I/usr/include/qt4/QtHelp \
-I/usr/include/qt4/QtUiTools \
-I/usr/include/qt4/QtTest \
-I/usr/include/qt4/QtScript \
-I/usr/include/qt4/QtSvg \
-I/usr/include/qt4/Qt3Support \
-I/usr/include/qt4/QtGui \
-I/usr/include/qt4/QtCore \
-I/usr/share/qt4/mkspecs/default \
-I/usr/include/qt4 \
-I/home/hakon/Qt4-0.99.0/src \
-I/home/hakon/Qt4-0.99.0/smokeqt \
-I/home/hakon/Qt4-0.99.0/smokegen \
-I/home/hakon/Qt4-0.99.0/smokeqt/qtdbus \
-I/home/hakon/Qt4-0.99.0/smoke \
-I/home/hakon/Qt4-0.99.0/smoke/qtdbus \
-O3 -DNDEBUG -fPIC -o CMakeFiles/smokeqtdbus.dir/x_1.cpp.o \
-c /home/hakon/Qt4-0.99.0/smokeqt/qtdbus/x_1.cpp
/home/hakon/Qt4-0.99.0/smokeqt/qtdbus/x_1.cpp:1594:7: error: deleted function ‘virtual __smokeqtdbus::x_QDBusConnectionInterface::~x_QDBusConnectionInterface()’
class x_QDBusConnectionInterface : public QDBusConnectionInterface {
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt4/QtDBus/QtDBus:8:0,
from /home/hakon/Qt4-0.99.0/smokeqt/qtdbus/qtdbus_includes.h:2,
from /home/hakon/Qt4-0.99.0/smokeqt/qtdbus/x_1.cpp:2:
/usr/include/qt4/QtDBus/qdbusconnectioninterface.h:73:5: error: overriding non-deleted function ‘virtual QDBusConnectionInterface::~QDBusConnectionInterface()’
~QDBusConnectionInterface();
^
/home/hakon/Qt4-0.99.0/smokeqt/qtdbus/x_1.cpp:1594:7: note: ‘virtual __smokeqtdbus::x_QDBusConnectionInterface::~x_QDBusConnectionInterface()’ is implicitly deleted because the default definition would be ill-formed:
class x_QDBusConnectionInterface : public QDBusConnectionInterface {
^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hakon/Qt4-0.99.0/smokeqt/qtdbus/x_1.cpp:1594:7: error: ‘virtual QDBusConnectionInterface::~QDBusConnectionInterface()’ is private within this context这些线程可能相关:
发布于 2017-04-03 21:08:57
似乎在派生类x_QDBusConnectionInterface中缺少一个析构函数。
/home/hakon/Qt4-0.99.0/smokeqt/qtdbus/x_1.cpp:1594:7:注意:“虚拟__smokeqtdbus::x_QDBusConnectionInterface::~x_QDBusConnectionInterface()’被隐式删除,因为默认定义可能格式不正确:
通过在/home/hakon/Qt4-0.99.0/smokeqt/qtdbus/x_1.cpp第1595行插入默认析构函数
~x_QDBusConnectionInterface();错误消失了。但是,其他三个文件现在也出现了这个缺失的析构函数错误:
/home/hakon/Qt4-0.99.0/smokeqt/qtgui/x_3.cpp:4024/home/hakon/Qt4-0.99.0/smokeqt/qtgui/x_13.cpp:3572/home/hakon/Qt4-0.99.0/smokeqt/qthelp/x_1.cpp:873修复这些错误的方式与第一个相同,仍然出现了一个新的错误:
/home/hakon/Qt4-0.99.0/qtcore/src/util.cpp: In function ‘void
XS_AUTOLOAD(CV*)’: /home/hakon/Qt4-0.99.0/qtcore/src/util.cpp:2234:59:
error: cannot convert ‘bool’ to ‘void*’ in initialization
static smokeperl_object nothis = { 0, 0, 0, false };
^smokeperl_object的定义在第9行的/home/hakon/Qt4-0.99.0/qtcore/src/smokeperl.h中给出:
struct smokeperl_object {
bool allocated;
Smoke* smoke;
int classId;
void* ptr;
};根据这个定义,将false at /home/hakon/Qt4-0.99.0/qtcore/src/util.cpp:2234替换为0似乎是一个很好的尝试:
static smokeperl_object nothis = { 0, 0, 0, 0 };没有重新编译此错误,但显示了链接器错误:
/usr/bin/c++ -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong \
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG \
-shared -Wl,-soname,QtCore4.so -o ../../blib/arch/auto/QtCore4/QtCore4.so \
CMakeFiles/perlqtcore4.dir/binding.cpp.o \
CMakeFiles/perlqtcore4.dir/handlers.cpp.o \
CMakeFiles/perlqtcore4.dir/marshall_types.cpp.o \
CMakeFiles/perlqtcore4.dir/util.cpp.o \
CMakeFiles/perlqtcore4.dir/QtCore4.c.o \
-lQtCore -lQtGui -lQtNetwork \
/home/hakon/perlbrew/perls/perl-5.24.1/lib/5.24.1/x86_64-linux/CORE/libperl.a \
../../smokeqt/qtgui/libsmokeqtgui.so.3.0.0 \
../../smokeqt/qtnetwork/libsmokeqtnetwork.so.3.0.0 \
-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -lQtGui -lQtNetwork \
../../smokeqt/qtcore/libsmokeqtcore.so.3.0.0 -lQtCore \
../../smokegen/bin/libsmokebase.so.3.0.0 \
-Wl,-rpath,/home/hakon/Qt4-0.99.0/smokeqt/qtgui:/home/hakon/Qt4-0.99.0/smokeqt/qtnetwork:/home/hakon/Qt4-0.99.0/smokeqt/qtcore:/home/hakon/Qt4-0.99.0/smokegen/bin:
/usr/bin/ld: /home/hakon/perlbrew/perls/perl-5.24.1/lib/5.24.1/x86_64-linux/CORE/libperl.a(toke.o):
relocation R_X86_64_PC32 against symbol `PL_curcop' can not be used when making
a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status我仍然不知道如何纠正最后一个错误。
https://stackoverflow.com/questions/43191675
复制相似问题