Discussion:
[yocto] rocko cmake buld cstdlib:75:15: fatal error: stdlib.h: No such file or directory
Måns Zigher
2018-04-17 11:15:27 UTC
Permalink
Hi all,

Have anyone experienced this error message before?

c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
| #include_next <stdlib.h>
| ^~~~~~~~~~
I am not seeing this error when cross compiling using the sdk. I can see in
the output that the -isystem is added which when googling the error appears
to be a problem when cross compiling. Since the sdk works I am guessing
this flag is added by OE/poky. Any pointers on how to go forward is
appreciated.

BR
Mans Zigher
Dennis Menschel
2018-04-17 17:57:07 UTC
Permalink
Hi Mans,
Post by MÃ¥ns Zigher
Hi all,
Have anyone experienced this error message before?
c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or
directory                       
|  #include_next <stdlib.h>                                         
|                ^~~~~~~~~~                                         
I am not seeing this error when cross compiling using the sdk. I can see
in the output that the -isystem is added which when googling the error
appears to be a problem when cross compiling. Since the sdk works I am
guessing this flag is added by OE/poky. Any pointers on how to go
forward is appreciated.
BR
Mans Zigher
if I recall correctly, the problem can be circumvented by adding the
option "-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1" when invoking cmake.

You can find a reference in the function "cmake_do_configure()" located
inside "poky/meta/classes/cmake.bbclass"

Best regards,
Dennis
Måns Zigher
2018-04-17 18:31:24 UTC
Permalink
Hi,

I actually managed to locate the problem to the cmake project where it
added include_directories(SYSTEM which then is translated into -isystem
this call was not included when building in the SDK so that explained why
this was only triggered when building with bitbake. Thanks for the tip I
will try it out and see what "cmake_do_configure()" can offer.

Br
Mans Zigher
Post by Dennis Menschel
Hi Mans,
Post by MÃ¥ns Zigher
Hi all,
Have anyone experienced this error message before?
c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
| #include_next <stdlib.h>
| ^~~~~~~~~~
I am not seeing this error when cross compiling using the sdk. I can see
in the output that the -isystem is added which when googling the error
appears to be a problem when cross compiling. Since the sdk works I am
guessing this flag is added by OE/poky. Any pointers on how to go
forward is appreciated.
BR
Mans Zigher
if I recall correctly, the problem can be circumvented by adding the
option "-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1" when invoking cmake.
You can find a reference in the function "cmake_do_configure()" located
inside "poky/meta/classes/cmake.bbclass"
Best regards,
Dennis
Måns Zigher
2018-04-18 04:56:57 UTC
Permalink
Hi Dennis,

This makes me a bot confused in cmake_do_configure we have

-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
${EXTRA_OECMAKE} \
-Wno-dev

I would think that I am using this cmake_do_configure so then the
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 should already be called correct?

BR
Mans Zigher
Post by MÃ¥ns Zigher
Hi,
I actually managed to locate the problem to the cmake project where it
added include_directories(SYSTEM which then is translated into -isystem
this call was not included when building in the SDK so that explained why
this was only triggered when building with bitbake. Thanks for the tip I
will try it out and see what "cmake_do_configure()" can offer.
Br
Mans Zigher
Post by Dennis Menschel
Hi Mans,
Post by MÃ¥ns Zigher
Hi all,
Have anyone experienced this error message before?
c++/7.3.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
| #include_next <stdlib.h>
| ^~~~~~~~~~
I am not seeing this error when cross compiling using the sdk. I can see
in the output that the -isystem is added which when googling the error
appears to be a problem when cross compiling. Since the sdk works I am
guessing this flag is added by OE/poky. Any pointers on how to go
forward is appreciated.
BR
Mans Zigher
if I recall correctly, the problem can be circumvented by adding the
option "-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1" when invoking cmake.
You can find a reference in the function "cmake_do_configure()" located
inside "poky/meta/classes/cmake.bbclass"
Best regards,
Dennis
Dennis Menschel
2018-04-18 20:46:58 UTC
Permalink
Hi Mans,
Post by MÃ¥ns Zigher
Hi Dennis,
This makes me a bot confused in cmake_do_configure we have
          -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
          ${EXTRA_OECMAKE} \
          -Wno-dev
I would think that I am using this cmake_do_configure so then the
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 should already be called correct?
BR
Mans Zigher
if you use "devtool build" from the extensible SDK to build a recipe
that inherits cmake.bbclass, then the function cmake_do_configure() will
be called implicitly.

But if you manually compile a cmake project with the SDK, then that
function won't be used. If your SDK contains the package
nativesdk-cmake, then the SDK contains the following file:

$OECORE_NATIVE_SYSROOT/environment-setup.d/cmake.sh

This file will be sourced along with the rest of the SDK and set an
alias for cmake with an SDK-specific toolchain file.

To verify if the option CMAKE_NO_SYSTEM_FROM_IMPORTED has been set by
cmake, you can check if the file CMakeCache.txt (in the build directory)
contains an entry for CMAKE_NO_SYSTEM_FROM_IMPORTED. An alternative way
is to inspect the configuration via ccmake after calling cmake.

Best regards,
Dennis
Måns Zigher
2018-04-19 04:40:37 UTC
Permalink
Hi,

I am building with the SDK (not extensible) but it is also built as a
recipe when building an image. The recipe is inheriting cmake but it is
only in the image build that I am experiencing this problem which I
shouldn't since the cmake_do_configure should be called. I will try and run
bitbake -e on the recepie to see if I get any clear if the
cmake_do_configure is part of it or not.

Thanks for your time I appreciate it.

Br
Mans Zigher
Post by Dennis Menschel
Hi Mans,
Post by MÃ¥ns Zigher
Hi Dennis,
This makes me a bot confused in cmake_do_configure we have
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
${EXTRA_OECMAKE} \
-Wno-dev
I would think that I am using this cmake_do_configure so then the
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 should already be called correct?
BR
Mans Zigher
if you use "devtool build" from the extensible SDK to build a recipe
that inherits cmake.bbclass, then the function cmake_do_configure() will
be called implicitly.
But if you manually compile a cmake project with the SDK, then that
function won't be used. If your SDK contains the package
$OECORE_NATIVE_SYSROOT/environment-setup.d/cmake.sh
This file will be sourced along with the rest of the SDK and set an
alias for cmake with an SDK-specific toolchain file.
To verify if the option CMAKE_NO_SYSTEM_FROM_IMPORTED has been set by
cmake, you can check if the file CMakeCache.txt (in the build directory)
contains an entry for CMAKE_NO_SYSTEM_FROM_IMPORTED. An alternative way
is to inspect the configuration via ccmake after calling cmake.
Best regards,
Dennis
Loading...