Home | News | Documentation | Download

ROOT Can't Compile a Macro but a Makefile Can

I wasn’t sure what the correct category for this question is, so I put it in “Newbie” (this is my first post on this forum).

I created a .C program (macro), but get the following error when I compile it. There are additional errors, but I only copied and pasted up to the first fatal error:

root [0] .L program.C+
Info in <TMacOSXSystem::ACLiC>: creating shared library /file/path/to/my/program/./program_C.so
In file included from input_line_1:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:89:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdlib:86:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:94:
/Applications/root6/install/etc/cling/lib/clang/5.0.0/include/stdlib.h:8:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
              ^~~~~~~~~~

However, when I compile the program with a makefile, I do not receive any errors and the program runs just fine from the executable.

The issue is not unique to this program. I get the same error when I compile any macro with ROOT.

I have been thinking about updating my OS and/or xcode and rebuilding root, but am not quite sure exactly what the problem is (is there an easier/simpler solution?).

In case it is relevant, here is the output of the following commands:

bash-3.2$ /usr/bin/xcodebuild -version
Xcode 9.2
Build version 9C40b

bash-3.2$ root -l --version
ROOT Version: 6.19/01
Built for macosx64 on Jun 25 2019, 02:11:00
From heads/master@v6-19-01-280-ge8ba885322

My OS is macOS High Sierra 10.13.06

Thanks in advance for any help you can provide!


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.19/01
Platform: macOS High Sierra 10.13.06
Compiler: Not Provided


Welcome to the ROOT forum, @ackuhlma !

I don’t remember seeing that - but Xcode 9 is pretty old, so I might have forgotten. Could you share the line 94 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h - is it also #include_next <stdlib.h>?

Hi @Axel ! Thanks for your reply! Sorry for the delayed response!

Yes, line 94 is:
#include_next <stdlib.h>

You might just need to run xcode-select --install.

If that doesn’t help then the easiest for me :slight_smile: would be if you could grab the macOS 10.13 build from Release 62206 - ROOT - I suspect that this one will just work.

Note that macOS 10.13 isn’t receiving security updates from Apple anymore: it’s insecure to run this connected to the internet. I’d recommend upgrading macOS, Xcode, and ROOT.

1 Like