gyunaev/kchmviewer

Application build still fails with multiple linker errors "undefined reference"

u-235 opened this issue · 2 comments

u-235 commented

Application build still fails with multiple linker errors "undefined reference"

I tried to build the application from the RELEASE_8_0 and got errors during linking.

Environment

  • CPU Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz
  • RAM 3GB
  • OS Linux Mint 18.1 Serena with kernel Linux 4.4.0-53-generic i686 GNU/Linux
  • DE MATE Desktop Environment 1.16.2
  • Compiler g++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
  • Qt 5.5 qt5-default qt5-qmake qtbase5-dev qtbase5-dev-tools ibqt5sensors5-dev libqt5serialport5-dev libqt5svg5-dev libqt5websockets5-dev libqt5x11extras5-dev libqt5xmlpatterns5-dev qt3d5-dev qtdeclarative5-dev qtlocation5-dev qtpositioning5-dev qtscript5-dev qtsystems5-dev qttools5-dev qttools5-dev-tools libpoppler-qt5-dev qtquick1-5-dev
  • Qt 5.15.2 local build with QWebEngine support
  • Libraries libchm1 libchm-dev libzip4 libzip-dev

Preparing

base$ git clone https://github.com/gyunaev/kchmviewer.git
base$ mkdir build
base$ cd build
base/build$ qmake -r ../kchmviewer

Qmake output:

Reading $base$/kchmviewer/lib/lib.pro [$base$/build/lib]
 Reading $base$/kchmviewer/lib/libebook/libebook.pro [$base$/build/lib/libebook]
Reading $base$/kchmviewer/src/src.pro [$base$/build/src]

Build

base/build$ make

Compiling goes without errors

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DUSE_WEBKIT -DQT_NO_DEBUG -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I../../kchmviewer/src -I$base$/build/src -I../../kchmviewer/lib/libebook -isystem /usr/include/i386-linux-gnu/qt5 -isystem /usr/include/i386-linux-gnu/qt5/QtWebKitWidgets -isystem /usr/include/i386-linux-gnu/qt5/QtWebKit -isystem /usr/include/i386-linux-gnu/qt5/QtPrintSupport -isystem /usr/include/i386-linux-gnu/qt5/QtWidgets -isystem /usr/include/i386-linux-gnu/qt5/QtGui -isystem /usr/include/i386-linux-gnu/qt5/QtNetwork -isystem /usr/include/i386-linux-gnu/qt5/QtXml -isystem /usr/include/i386-linux-gnu/qt5/QtDBus -isystem /usr/include/i386-linux-gnu/qt5/QtCore -I$base$/build/src -I$base$/build/src -I/usr/lib/i386-linux-gnu/qt5/mkspecs/linux-g++ -o moc_viewwindow_webkit.o moc_viewwindow_webkit.cpp
g++ -Wl,-O1 -Wl,-rpath-link,/usr/lib/i386-linux-gnu -o ../bin/kchmviewer config.o dialog_chooseurlfromlist.o dialog_setup.o kde-qt.o main.o mainwindow.o recentfiles.o settings.o tab_bookmarks.o tab_contents.o tab_index.o tab_search.o viewwindowmgr.o navigationpanel.o checknewversion.o toolbarmanager.o toolbareditor.o textencodings.o treeitem_toc.o treeitem_index.o dbus_interface.o viewwindow_webkit.o dataprovider_qwebkit.o qrc_images.o moc_dialog_chooseurlfromlist.o moc_dialog_setup.o moc_mainwindow.o moc_recentfiles.o moc_tab_bookmarks.o moc_tab_contents.o moc_tab_index.o moc_tab_search.o moc_viewwindowmgr.o moc_navigationpanel.o moc_checknewversion.o moc_toolbarmanager.o moc_toolbareditor.o moc_dbus_interface.o moc_viewwindow_webkit.o   -lchm -lzip -lX11 ../lib/libebook/libebook.a -lQt5WebKitWidgets -lQt5WebKit -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Xml -lQt5DBus -lQt5Core -lGL -lpthread 
../lib/libebook/libebook.a(ebook_chm.o): In function `EBook_CHM::close()':
ebook_chm.cpp:(.text+0xc22): undefined reference to `chm_close'
../lib/libebook/libebook.a(ebook_chm.o): In function `EBook_CHM::ResolveObject(QString const&, chmUnitInfo*) const':
ebook_chm.cpp:(.text+0x129e): undefined reference to `chm_resolve_object'
../lib/libebook/libebook.a(ebook_chm.o): In function `EBook_CHM::hasFile(QString const&) const':
ebook_chm.cpp:(.text+0x1450): undefined reference to `chm_resolve_object'
../lib/libebook/libebook.a(ebook_chm.o): In function `EBook_CHM::RetrieveObject(chmUnitInfo const*, unsigned char*, unsigned long long, long long) const':
ebook_chm.cpp:(.text+0x154f): undefined reference to `chm_retrieve_object'
../lib/libebook/libebook.a(ebook_chm.o): In function `EBook_CHM::enumerateFiles(QList<QUrl>&)':
ebook_chm.cpp:(.text+0x35ef): undefined reference to `chm_enumerate'
../lib/libebook/libebook.a(ebook_chm.o): In function `EBook_CHM::load(QString const&)':
ebook_chm.cpp:(.text+0x6d55): undefined reference to `chm_open'
../lib/libebook/libebook.a(ebook_epub.o): In function `EBook_EPUB::close()':
ebook_epub.cpp:(.text+0x80): undefined reference to `zip_close'
../lib/libebook/libebook.a(ebook_epub.o): In function `EBook_EPUB::getFileAsBinary(QByteArray&, QString const&) const':
ebook_epub.cpp:(.text+0x9ad): undefined reference to `zip_stat'
ebook_epub.cpp:(.text+0xbc3): undefined reference to `zip_fopen_index'
ebook_epub.cpp:(.text+0xc44): undefined reference to `zip_fread'
ebook_epub.cpp:(.text+0xc59): undefined reference to `zip_fclose'
ebook_epub.cpp:(.text+0xcf5): undefined reference to `zip_fclose'
../lib/libebook/libebook.a(ebook_epub.o): In function `EBook_EPUB::load(QString const&)':
ebook_epub.cpp:(.text+0x3707): undefined reference to `zip_fdopen'
collect2: error: ld returned 1 exit status

Compiler g++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609

Can you try with a newer compiler? It builds fine as-is with gcc version 7.5.0

Fixed in 9ac73e7..e3b09ed