New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation on Debian Buster (testing) fails because it can't find stdlib.h #90

Open
legoktm opened this Issue Dec 28, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@legoktm
Copy link
Member

legoktm commented Dec 28, 2018

branch@debian:~/kiwix-desktop$ make
/usr/lib/qt5/bin/uic ui/mainwindow.ui -o ui_mainwindow.h
/usr/lib/qt5/bin/uic ui/about.ui -o ui_about.h
/usr/lib/qt5/bin/uic src/tocsidebar.ui -o ui_tocsidebar.h
/usr/lib/qt5/bin/uic src/contentmanagerside.ui -o ui_contentmanagerside.h
/usr/lib/qt5/bin/uic src/readinglistbar.ui -o ui_readinglistbar.h
g++ -c -pipe -std=c++11 -O2 -Wall -W -D_REENTRANT -fPIC -DGIT_VERSION="2.0-beta2-1-g084e851" -DBUILD_DATE="Thu Dec 27 21:10:46 PST 2018" -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WEBENGINEWIDGETS_LIB -DQT_WEBENGINECORE_LIB -DQT_QUICK_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_WEBCHANNEL_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_POSITIONING_LIB -DQT_CORE_LIB -I. -isystem /usr/include -isystem /usr/include/pugixml-1.9 -isystem /usr/include/x86_64-linux-gnu -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebEngineWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebEngineCore -isystem /usr/include/x86_64-linux-gnu/qt5/QtQuick -isystem /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtWebChannel -isystem /usr/include/x86_64-linux-gnu/qt5/QtQml -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtPositioning -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o main.o src/main.cpp
In file included from /usr/include/c++/8/ext/string_conversions.h:41,
                 from /usr/include/c++/8/bits/basic_string.h:6400,
                 from /usr/include/c++/8/string:52,
                 from /usr/include/kiwix/book.h:23,
                 from src/library.h:4,
                 from src/kiwixapp.h:4,
                 from src/main.cpp:1:
/usr/include/c++/8/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~
compilation terminated.

After a bit of digging it was because the include paths were being messed with. Here's the patch I used to get it to build:

branch@debian:~/kiwix-desktop$ git diff
diff --git a/kiwix-desktop.pro b/kiwix-desktop.pro
index 04969d0..2413e31 100644
--- a/kiwix-desktop.pro
+++ b/kiwix-desktop.pro
@@ -96,9 +96,9 @@ isEmpty(PREFIX) {
 target.path = $$PREFIX/bin
 INSTALLS += target
 
-static {
-  PKGCONFIG_OPTION = "--static"
-}
+#static {
+#  PKGCONFIG_OPTION = "--static"
+#}
 
 unix {
   QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN/../lib64\ '"
@@ -138,7 +138,7 @@ PKGCONFIG_DEFINES ~= s/^-D(.*)/\\1/g
 
 PKGCONFIG_CFLAGS ~= s/^-[ID].*//g
 
-INCLUDEPATH *= $$PKGCONFIG_INCLUDEPATH
+#INCLUDEPATH *= $$PKGCONFIG_INCLUDEPATH
 DEFINES *= $$PKGCONFIG_DEFINES
 
 QMAKE_CXXFLAGS += $$PKGCONFIG_CFLAGS

@kelson42 kelson42 changed the title Complition on Debian Buster (testing) fails because it can't find stdlib.h Compilation on Debian Buster (testing) fails because it can't find stdlib.h Dec 28, 2018

@mgautierfr

This comment has been minimized.

Copy link
Member

mgautierfr commented Jan 7, 2019

After a bit of digging it was because the include paths were being messed with

How they were messed up ?
It is surprising that we can find include files through /usr/include/c++/8/cstdlib (precompiled header ?) and not to stdlib.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment