Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

stdlib.h not found



  • Hi all.

    I want to use an external library with Qt5 on RaspberryPi3, but it doesn't go well with an error.
    I installed the wiringPi library using apt.
    After that, Qt5 project file .pro external library was added.

    unix:! macx: LIBS + = -L $$ PWD /../../../../../ usr / lib / -lwiringPi
    INCLUDEPATH + = $$ PWD /../../../../../ usr / include
    DEPENDPATH + = $$ PWD /../../../../../ usr / include

    However, when I build, I get the following error:

    /usr/include/c++/8/bits/stl_algo.h:59:
    / usr / include / c ++ / 8 / algorithm: 62:
    /usr/include/arm-linux-gnueabihf/qt5/QtCore/qglobal.h:142:
    /usr/include/arm-linux-gnueabihf/qt5/QtGui/qtguiglobal.h:43:
    /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qtwidgetsglobal.h:43:
    /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qmainwindow.h:43:
    / usr / include / arm-linux-gnueabihf / qt5 / QtWidgets / QMainWindow: 1:
    /home/pi/Qt/illumination/mainwindow.h:4:
    /home/pi/Qt/illumination/main.cpp:1:
    / usr / include / c ++ / 8 / cstdlib: 75:
    ?Error: stdlib.h: No such file or directory
    ?#include_next <stdlib.h>

    I don't know the cause of this error.
    Thank you.


  • Lifetime Qt Champion

    @taku-s looks like your toolchain has a setup problem.

    Are you cross compiling or directly on the PI? Which toolchain are you using?

    Regards



  • @taku-s said in stdlib.h not found:

    unix:! macx: LIBS + = -L $$ PWD /../../../../../ usr / lib / -lwiringPi
    INCLUDEPATH + = $$ PWD /../../../../../ usr / include
    DEPENDPATH + = $$ PWD /../../../../../ usr / include

    in addition to answer @aha_1980 questions, are those paths Ok? I can see lots of spaces



  • Thank you very much.
    After all, it seems that it was a problem of g ++
    It was solved by apt-get update.


  • Lifetime Qt Champion

    Hi @taku-s,

    glad you figured it out. So please mark this topic as SOLVED. Thanks!



  • It was a mistake to say that updating solved the problem.
    Definitely, once I was able to build and run, the next error was the same.
    I tried out Pablo J. Rogina's “number of passes problem” and now I can build it.
    Thank you very mutch.

    But I can't rest assured.
    This time, it is a path automatically created by QtCreator, but when I added an absolute path manually, I saw the same error.

    For the time being, let's see the situation


Log in to reply