Boost 1.76.0: /usr/include/c++/11.1.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory

7
open
synthead
synthead
Posted 7 months ago

Boost 1.76.0: /usr/include/c++/11.1.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory #587

Description of bug:

When building against boost 1.76.0, this error is raised during make:

make[2]: Entering directory '/home/max/aur/pcb2gcode-git/src/pcb2gcode'
  CXX      autoleveller.o
In file included from /usr/include/c++/11.1.0/ext/string_conversions.h:41,
                 from /usr/include/c++/11.1.0/bits/basic_string.h:6594,
                 from /usr/include/c++/11.1.0/string:55,
                 from autoleveller.hpp:29,
                 from autoleveller.cpp:20:
/usr/include/c++/11.1.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
   75 | #include_next <stdlib.h>
      |               ^~~~~~~~~~

This happens against the latest commit in the master branch at the time of this writing, 5459c2962e2fd9f059c629b143737053efa838cb.

Here is the full result of autoreconf, ./configure, and make: https://gist.github.com/synthead/10b33c5d7828dabf6dce224cb1b7f730

This is on Arch Linux.

Downgrading boost to 1.75.0 seems to be a good workaround for this issue:

How to downgrade boost and boost-libs with downgrade in Arch Linux
$ sudo downgrade boost-libs boost
Available packages (extra):

-   1)  boost    1.69.0  1  remote
-   2)  boost    1.69.0  2  remote
    3)  boost    1.71.0  1  remote
-   4)  boost    1.71.0  2  remote
    5)  boost    1.71.0  3  remote
-   6)  boost    1.71.0  4  remote
-   7)  boost    1.72.0  1  remote
-   8)  boost    1.72.0  2  remote
    9)  boost    1.72.0  3  remote
-  10)  boost    1.72.0  4  remote
   11)  boost    1.74.0  1  remote
-  12)  boost    1.74.0  2  remote
-  13)  boost    1.75.0  1  remote
-  14)  boost    1.75.0  2  remote
-  15)  boost    1.75.0  3  remote
   16)  boost    1.75.0  4  remote
   17)  boost    1.75.0  5  remote
   18)  boost    1.75.0  5  /var/cache/pacman/pkg
+  19)  boost    1.76.0  1  remote
+  20)  boost    1.76.0  1  /var/cache/pacman/pkg

select a package by number: 18
Available packages (extra):

-   1)  boost-libs    1.69.0  1  remote
-   2)  boost-libs    1.69.0  2  remote
    3)  boost-libs    1.71.0  1  remote
-   4)  boost-libs    1.71.0  2  remote
    5)  boost-libs    1.71.0  3  remote
-   6)  boost-libs    1.71.0  4  remote
-   7)  boost-libs    1.72.0  1  remote
-   8)  boost-libs    1.72.0  2  remote
    9)  boost-libs    1.72.0  3  remote
-  10)  boost-libs    1.72.0  4  remote
   11)  boost-libs    1.74.0  1  remote
-  12)  boost-libs    1.74.0  2  remote
-  13)  boost-libs    1.75.0  1  remote
-  14)  boost-libs    1.75.0  2  remote
-  15)  boost-libs    1.75.0  3  remote
   16)  boost-libs    1.75.0  4  remote
   17)  boost-libs    1.75.0  5  remote
   18)  boost-libs    1.75.0  5  /var/cache/pacman/pkg
+  19)  boost-libs    1.76.0  1  remote
+  20)  boost-libs    1.76.0  1  /var/cache/pacman/pkg

select a package by number: 18
loading packages...
warning: downgrading package boost (1.76.0-1 => 1.75.0-5)
warning: downgrading package boost-libs (1.76.0-1 => 1.75.0-5)
resolving dependencies...
looking for conflicting packages...

Packages (2) boost-1.75.0-5  boost-libs-1.75.0-5

Total Installed Size:  178.46 MiB
Net Upgrade Size:        0.79 MiB

:: Proceed with installation? [Y/n] 
(2/2) checking keys in keyring                                                                                    [####################################################################] 100%
(2/2) checking package integrity                                                                                  [####################################################################] 100%
(2/2) loading package files                                                                                       [####################################################################] 100%
(2/2) checking for file conflicts                                                                                 [####################################################################] 100%
(2/2) checking available disk space                                                                               [####################################################################] 100%
:: Processing package changes...
(1/2) downgrading boost-libs                                                                                      [####################################################################] 100%
(2/2) downgrading boost                                                                                           [####################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
add boost to IgnorePkg? [y/N] n
add boost-libs to IgnorePkg? [y/N] n

Packages:

  • boost 1.76.0-1
  • boost-libs 1.76.0-1
  • gcc 11.1.0-1
  • glibc 2.33-5

What did you try (include command-line arguments):

  1. Have an updated Arch Linux system available with boost to 1.76.0-1
  2. Attempt to build pcb2gcode from the AUR or the common build steps (both reproduces the error).
  3. Observe that the error above is displayed, and the build stops.

What happened:

This error is raised during compilation:

/usr/include/c++/11.1.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory

What did you expect to happen:

No error is raised during compilation.

pcb2gcode version (run pcb2gcode --version to see this):

pcb2gcode does not build, and --version cannot be called.