2017-04-03 70 views
0

我試圖在Ubuntu 16.10安裝QtCore4,perl的版本5.24.1:無法在Ubuntu 16.10,perl的版本上安裝QtCore4 5.24.1

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 

這些線程可能涉及:

回答

0

好像有在派生類x_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:

通過/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定義在/home/hakon/Qt4-0.99.0/qtcore/src/smokeperl.h第9行給出:

struct smokeperl_object { 
    bool allocated; 
    Smoke* smoke; 
    int classId; 
    void* ptr; 
}; 

根據這個定義,取代了false/home/hakon/Qt4-0.99.0/qtcore/src/util.cpp:22340似乎是一個很好的嘗試:

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 

我仍然不知道如何解決這個最後的錯誤..

+0

是否與'-fPIC'(如編譯器的建議)的新問題幫助重新編譯? – hlt

+0

@hlt我認爲它需要使用'-fPIC'標誌重新編譯'libperl.a'中的目標文件。我不確定如何執行此操作,請參閱[this](http://stackoverflow.com/q/) 43203477/2173773)的問題。 –

+0

新增[cpan錯誤報告](https://rt.cpan.org/Ticket/Display.html?id=121203) –