Проблемы при связывании с LLVM с проектом, включающим Flex и Bison

Я работал с учебником по написанию компиляторов с Flex, Bison и LLVM (http://gnuu.org/2009/09/18/writing-your-own-toy-compiler/), а попытка скомпилировать окончательный двоичный файл завершается неудачно со многими из следующих "неопределенных ссылок" "ошибки:

g++ -o parser `llvm-config --libs core jit native --cxxflags --ldflags` *.cpp
/tmp/ccl0CSyi.o: In function `NBinaryOperator::codeGen(CodeGenContext&)':
codegen.cpp:(.text+0x2ce): undefined reference to     `llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value*, llvm::Value*,     llvm::Twine const&, llvm::BasicBlock*)'
/tmp/ccl0CSyi.o: In function `NDouble::codeGen(CodeGenContext&)':
codegen.cpp:(.text+0x3db): undefined reference to `llvm::getGlobalContext()'
codegen.cpp:(.text+0x3e3): undefined reference to     `llvm::Type::getDoubleTy(llvm::LLVMContext&)'
/tmp/ccl0CSyi.o: In function `NInteger::codeGen(CodeGenContext&)':
...
collect2: ld returned 1 exit status
make: *** [parser] Error 1

Насколько я знаю, у меня есть все необходимые включения, и сценарий llvm-config работает правильно --- кто-нибудь знает, как исправить эти ошибки?

5
задан Jonathan Leffler 6 May 2013 в 20:53
поделиться