QNapi / qnapi

Qt-based, multi-engine, multi-platform subtitle downloader
http://qnapi.github.io
291 stars 39 forks source link

Compilation error #68

Closed kubaugustyn closed 8 years ago

kubaugustyn commented 8 years ago

OS: Arch Linux Qt v. 5.6.0-5

I get this error when trying to compile package (package from AUR has the same problem):

uic ui/frmprogress.ui
uic ui/frmlistsubtitles.ui
uic ui/frmsummary.ui
uic ui/frmscan.ui
uic ui/frmoptions.ui
uic ui/frmabout.ui
uic ui/napiprojekt/frmnapiprojektconfig.ui
uic ui/napiprojekt/frmnapiprojektcorrect.ui
uic ui/napiprojekt/frmnapiprojektreport.ui
uic ui/napiprojekt/frmnapiprojektupload.ui
uic ui/opensubtitles/frmopensubtitlesconfig.ui
uic ui/frmconvert.ui
uic ui/subDataWidget.ui
compiling src/main.cpp
In file included from /usr/include/c++/6.1.1/bits/stl_algo.h:59:0,
                 from /usr/include/c++/6.1.1/algorithm:62,
                 from /usr/include/qt/QtCore/qglobal.h:85,
                 from /usr/include/qt/QtCore/qcoreapplication.h:37,
                 from /usr/include/qt/QtWidgets/qapplication.h:37,
                 from /usr/include/qt/QtWidgets/QApplication:1,
                 from src/main.cpp:15:
/usr/include/c++/6.1.1/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next <stdlib.h>
                         ^
compilation terminated.
Makefile:925: recipe for target 'tmp/main.o' failed
make: *** [tmp/main.o] Error 1

gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 6.1.1 20160501 (GCC) 
krzemin commented 8 years ago

This problem is rather caused by gcc6 which provides its own stdlib.h wrapper. Apparently qmake is not aware of that.

For quick fix, just compile with: qmake QMAKE_DEFAULT_INCDIRS="" && make