[cfe-dev] Using libcxx and libcxxabi from a build tree on OS X

Meador Inge meadori at gmail.com
Wed Feb 18 15:17:06 PST 2015


Hi All,

What is the correct way to use libcxx from a build dir on OS X?

I am running into the following issue:

  $ pwd
  /Users/meadori/Code/build/llvm

  $ cat test.cpp
  #include <exception>

  int main(void)
  {
     std::terminate();
     return 0;
  }
  $ ./bin/clang++ -L/Users/meadori/Code/build/llvm/lib test.cpp
  Undefined symbols for architecture x86_64:
    "std::terminate()", referenced from:
        _main in test-648ddf.o
  ld: symbol(s) not found for architecture x86_64
  clang-3.7: error: linker command failed with exit code 1 (use -v to
see invocation)

It would seem that the built libc++abi library isn't being found.

Have other encountered this?

I noticed that all the libcxx tests explicitly add -lc++abi.

-- 
# Meador



More information about the cfe-dev mailing list