I was trying the provided CLING executable from your nightly build, namely cling-MacOSX-10.8-64bit-4d98a76dec.
On First run I am getting:
ERROR in cling::CIFactory::createCI():
Possible C++ standard library mismatch, compiled with __GLIBCXX__ v20070719 but cannot extract standard library version from current compiler clang++
input_line_1:1:10: fatal error: 'cling/Interpreter/RuntimeUniverse.h' file not found
#include "cling/Interpreter/RuntimeUniverse.h"
^
Assertion failed: (clingAtExit && "cling_cxa_atexit must exist."), function remapCXAAtExit, file /ec/build/cling-4d98a76decae-full-1247013/cling-src-4d98a76decaefccfabdbcc9a73b124ecbe93260d/tools/cling/lib/Interpreter/ExecutionContext.cpp, line 57.
Illegal instruction: 4
So I have copied cling includes in /usr/local/include, the include error has disappeared but now I get:
ERROR in cling::CIFactory::createCI():
Possible C++ standard library mismatch, compiled with __GLIBCXX__ v20070719 but cannot extract standard library version from current compiler clang++
ExecutionContext: use of undefined symbol '_ZN5cling7runtime8internal21__trigger__cxa_atexitD1Ev'!
ExecutionContext::runStaticInitializersOnce: symbol '_ZN5cling7runtime8internal21__trigger__cxa_atexitD1Ev' unresolved while linking static initializer '_GLOBAL__I_a'!
Assertion failed: (0 && "Error on inits."), function commitTransaction, file /ec/build/cling-4d98a76decae-full-1247013/cling-src-4d98a76decaefccfabdbcc9a73b124ecbe93260d/tools/cling/lib/Interpreter/IncrementalParser.cpp, line 279.
Illegal instruction: 4
My configuration is OSX 10.9 Mavericks with Xcode 5.0.2 installed (not sure if it affects anything, I am actually “starting” to understand how cling works )
Any hints?
the build is successful but running the resulting cling yields:
In file included from input_line_3:1:
In file included from /Users/stefano/Code/External/cling/llvm/tools/cling/include/cling/Interpreter/ValuePrinter.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:430:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:90:10: fatal error: 'wchar.h' file not found
#include <wchar.h> // for mbstate_t
^
Segmentation fault: 11
So I’ve added path to wchar.h for 10.9 sdk but still getting errors on the linker.
[cling]$ auto a = “asd”;
[cling]$ a
ExecutionContext: use of undefined symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv’!
ExecutionContext: use of undefined symbol ‘ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS4’!
ExecutionContext: use of undefined symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4sizeEv’!
ExecutionContext: use of undefined symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4dataEv’!
ExecutionContext::executeFunction: symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13get_allocatorEv’ unresolved while linking function ‘_Z15__cling_Un1Qu31v’!
ExecutionContext::executeFunction: symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4dataEv’ unresolved while linking function ‘_Z15__cling_Un1Qu31v’!
ExecutionContext::executeFunction: symbol ‘_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4sizeEv’ unresolved while linking function ‘_Z15__cling_Un1Qu31v’!
ExecutionContext::executeFunction: symbol ‘ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS4’ unresolved while linking function ‘_Z15__cling_Un1Qu31v’![/code]