Undefined reference when linking to clang libraries

I’m developing off of tags/RELEASE_29/final. During the linking phase of compiling my program, I get an error that a function inside of one of clang’s libraries has an undefined reference to another function in one of clang’s libraries. I copied the command line invocation of g++ off of a previous email to this list, so I’m hoping it’s correct.

Invocation and error:
$ LLVM=~/workspace/llvm/Debug
$ g++ $LLVM/bin/llvm-config --cxxflags --ldflags instmem.cpp -lclangFrontend -lclangDriver -lclangSerialization -lclangParse -lclangSema -lclangAnalysis -lclangAST -lclangLex -lclangBasic $LLVM/bin/llvm-config --libs -o instmem
/home/alexander/workspace/llvm/Debug/lib/libclangSerialization.a(ASTReader.o): In function clang::PCHValidator::ReadPredefinesBuffer(llvm::SmallVector<clang::PCHPredefinesBlock, 2u> const&, llvm::StringRef, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, clang::FileManager&)': /home/alexander/workspace/llvm/tools/clang/lib/Serialization/ASTReader.cpp:256: undefined reference to clang::NormalizeDashIncludePath(llvm::StringRef, clang::FileManager&)’
collect2: ld returned 1 exit status


#include <clang/Frontend/CompilerInvocation.h>
#include <clang/Basic/DiagnosticIDs.h>

int main(int argc, char *argv)
clang::CompilerInvocation invocation;
llvm::IntrusiveRefCntPtrclang::DiagnosticIDs DiagID(new clang::DiagnosticIDs());
clang::Diagnostic Diags(DiagID);

clang::CompilerInvocation::CreateFromArgs(invocation, argv, argv+argc, Diags);

return 0;

If anyone could tell me where I’m messing up, I’d appreciate it.