Error with stdlib.h: "fatal error: 'stdlib.h' file not found"

Hello Everyone,

I’m trying to run a macros in order to analyse some data on a MacOS Catalina. However, it all fails at the compile step. The first error I get (and which spawns most of the others) is this one:

/opt/local/libexec/root6/etc/root/cling/lib/clang/5.0.0/include/stdlib.h:8:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>

That file contains the following:

#ifndef ROOT_INCLUDE_STDLIB_H
#define ROOT_INCLUDE_STDLIB_H
/* axel@cern.ch, 2015-06-02
   NOT part of clang but injected by ROOT.
   Adds include guards for stdlib.h to avoid re-parse from disk.
*/

#include_next <stdlib.h>

#endif /*ROOT_INCLUDE_STDLIB_H*/

As far as I understand ROOT can’t find the stdlib.h . I have that library located in:

 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h

How can I fix this? I never before had a problem like this when running other macros.

Sorry if this thread is misplaced and thanks to all for your help in advance.

I think we would need some more information about the environment. Can you tell us the version of ROOT you are using and how you installed it? Also, what’s the command line you use to run the macro?

Cheers,
Jakob

I work with ROOT 6.20/00. The command I use to run the macros is:

.x /Users/macbookair/Desktop/fit_tool_2comp_prel/CombinedFit.C

This problem may have been solved with the latest ROOT version 6.24. The easiest would be following the instructions for installing the precompiled binaries. Just make sure you pick the binaries that match your version of macOS and Xcode.

Thanks.

I’ll try that and post the results.

Having installed the latest version of ROOT, the problem persists.

Can you run EXTRA_CLING_ARGS=-v root.exe and paste the output, please?

I don’t know what happended. But i run that same command, and ROOT now runs.

Thank you all for your help.

Thanks for getting back - let us know next time you get stuck!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.