Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Ubuntu Linux, stdlib.h not found...
QtWS25 Last Chance

Ubuntu Linux, stdlib.h not found...

Scheduled Pinned Locked Moved Solved Installation and Deployment
3 Posts 2 Posters 8.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    ve2ymv
    wrote on 19 Oct 2020, 20:48 last edited by
    #1

    Hello,

    I've been using Qt Creator for a year on Ubuntu Linux to create desktop applications.
    I started to have "stdlib.h not found" errors, even if the file is present.

    Here is an error dump from Qt Creator IDE:

    /usr/include/c++/7/cstdlib:75: erreur : stdlib.h: No such file or directory
    In file included from /usr/include/c++/7/bits/stl_algo.h:59:0,
                     from /usr/include/c++/7/algorithm:62,
                     from /home/newtrax/Qt/5.9/gcc_64/include/QtCore/qglobal.h:109,
                     from /home/newtrax/Qt/5.9/gcc_64/include/QtCore/qalgorithms.h:43,
                     from /home/newtrax/Qt/5.9/gcc_64/include/QtCore/qdebug.h:44,
                     from /home/newtrax/Qt/5.9/gcc_64/include/QtCore/QDebug:1,
                     from SafsMethodParser.cpp:1:
    /usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
     #include_next <stdlib.h>
                   ^~~~~~~~~~
    

    I've got the same message from the free and commercial versions.

    I've tried the following, without success

    • clean and re-run qmake and compile
    • wipe the project clean and get a fresh copy from Git repo
    • update cmake
    • update g++
    • With Manage Toolkits... check if there aren't any errors/warnings (none)

    Here's some basic information about my workstation:

    uname -a
    Linux ubuntu16 4.15.0-121-generic #123-Ubuntu SMP Mon Oct 5 16:16:40 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    

    Any pointers?

    Thanks!

    J 1 Reply Last reply 19 Oct 2020, 21:14
    0
    • V ve2ymv
      19 Oct 2020, 20:48

      Hello,

      I've been using Qt Creator for a year on Ubuntu Linux to create desktop applications.
      I started to have "stdlib.h not found" errors, even if the file is present.

      Here is an error dump from Qt Creator IDE:

      /usr/include/c++/7/cstdlib:75: erreur : stdlib.h: No such file or directory
      In file included from /usr/include/c++/7/bits/stl_algo.h:59:0,
                       from /usr/include/c++/7/algorithm:62,
                       from /home/newtrax/Qt/5.9/gcc_64/include/QtCore/qglobal.h:109,
                       from /home/newtrax/Qt/5.9/gcc_64/include/QtCore/qalgorithms.h:43,
                       from /home/newtrax/Qt/5.9/gcc_64/include/QtCore/qdebug.h:44,
                       from /home/newtrax/Qt/5.9/gcc_64/include/QtCore/QDebug:1,
                       from SafsMethodParser.cpp:1:
      /usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
       #include_next <stdlib.h>
                     ^~~~~~~~~~
      

      I've got the same message from the free and commercial versions.

      I've tried the following, without success

      • clean and re-run qmake and compile
      • wipe the project clean and get a fresh copy from Git repo
      • update cmake
      • update g++
      • With Manage Toolkits... check if there aren't any errors/warnings (none)

      Here's some basic information about my workstation:

      uname -a
      Linux ubuntu16 4.15.0-121-generic #123-Ubuntu SMP Mon Oct 5 16:16:40 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
      

      Any pointers?

      Thanks!

      J Offline
      J Offline
      JonB
      wrote on 19 Oct 2020, 21:14 last edited by
      #2

      @ve2ymv

      I started to have "stdlib.h not found" errors, even if the file is present.

      Present where?

      include_next <stdlib.h>

      I'm not familiar with that directive. Googling for include_next stdlib.h will doubtless give you enough links to solve your issue.

      1 Reply Last reply
      0
      • V Offline
        V Offline
        ve2ymv
        wrote on 19 Oct 2020, 21:39 last edited by ve2ymv
        #3

        Found it! The #include_next directive is a rather unusual one , and best explained with an example: suppose you have an include file path set to /usr/include and also /usr/local/include as an alternate path. Also suppose that both contains the stdlib.h file. #include_next will skip the one from /usr/include and pick the one in /usr/local/include.

        My problem was that I had a stray include path in my .pro file:

        INCLUDEPATH += /usr/include
        

        So I commented that one out and it compiled again. I guess that it broke the search order for C standard headers.

        1 Reply Last reply
        0

        3/3

        19 Oct 2020, 21:39

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved