Problem compiling with root

Please read tips for efficient and successful posting and posting code

ROOT Version: v_6.18/04
Platform: MacOsMojave
Compiler: g++(XCode)

I’ve downloaded root and I’m having some troubles.
When I try to compile a .cpp code linking to a root library I get the following error:

ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!


LC_ALL=C /Library/Developer/CommandLineTools/usr/bin/c++ -O2 -DNDEBUG -xc++ -E -v /dev/null 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | GREP_OPTIONS= grep -E "(c|g)\+\+"

Results was:

With exit code 256

warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk'

**input_line_1:1:10:** **fatal error:** **'new' file not found**

#include <new>


**input_line_3:37:10:** **fatal error:** **'string' file not found**

#include <string>


Looking forward to hearing your suggestions,

@oshadura @amadio any ideas here?

Do you have the command line tools and SDK headers installed? The directory above is where headers are picked from, so you need to have it.

Hi amadio,

How do I know wether I have them installed?

And, if I don’t, how do I install them?

You will have the directory with the SDK headers on your system.

You can install SDKs from XCode’s settings menu.

I think I solved it with the command:

xcode-select --install

Now root seems to work correctly.
Is there something else I should do?

No, that is probably enough. Let us know if you have problems in the future.

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