Thanks to everyone who contributed suggestions to solve my problem.
my problem was solved with this command line:
clang `llvm-config --cxxflags --libs` -lc++ -lncurses -O0 -o test main.cpp
Who would have thought that ncurses was needed for such a basic program as "hello world"!!
Again, many thanks