<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>I am new in clang , want to use clang to compiler a piece program,but I encounter a   problem , I need help,thank you!<br>I use LLVM 3.3 Centos 6.5 <br>llvm was installed in /usr/local/bin as well as lib.<br>when I compiler the program,the error as follows:    <br></div><blockquote>/tmp/cc33UrOx.o: In function `main':<br>aa.cpp:(.text+0x21): undefined reference to `clang::CompilerInstance::CompilerInstance()'<br>aa.cpp:(.text+0x3f): undefined reference to `clang::CompilerInstance::createDiagnostics(clang::DiagnosticConsumer*, bool)'<br>aa.cpp:(.text+0x4d): undefined reference to `clang::CompilerInstance::createFileManager()'<br>aa.cpp:(.text+0x6d): undefined reference to `clang::CompilerInstance::createSourceManager(clang::FileManager&)'<br>aa.cpp:(.text+0x7b): undefined reference to `clang::CompilerInstance::createPreprocessor()'<br>aa.cpp:(.text+0xc4): undefined reference to `clang::FileManager::getFile(llvm::StringRef, bool, bool)'<br>aa.cpp:(.text+0x10c): undefined reference to `clang::Preprocessor::EnterMainSourceFile()'<br>aa.cpp:(.text+0x1b5): undefined reference to `clang::Preprocessor::DumpToken(clang::Token const&, bool) const'<br>aa.cpp:(.text+0x214): undefined reference to `clang::CompilerInstance::~CompilerInstance()'<br>aa.cpp:(.text+0x237): undefined reference to `clang::CompilerInstance::~CompilerInstance()'<br>/tmp/cc33UrOx.o: In function `clang::SourceManager::createFileID(clang::FileEntry const*, clang::SourceLocation, clang::SrcMgr::CharacteristicKind, int, unsigned int)':<br>aa.cpp:(.text._ZN5clang13SourceManager12createFileIDEPKNS_9FileEntryENS_14SourceLocationENS_6SrcMgr18CharacteristicKindEij[clang::SourceManager::createFileID(clang::FileEntry const*, clang::SourceLocation, clang::SrcMgr::CharacteristicKind, int, unsigned int)]+0x26): undefined reference to `clang::SourceManager::getOrCreateContentCache(clang::FileEntry const*, bool)'<br>aa.cpp:(.text._ZN5clang13SourceManager12createFileIDEPKNS_9FileEntryENS_14SourceLocationENS_6SrcMgr18CharacteristicKindEij[clang::SourceManager::createFileID(clang::FileEntry const*, clang::SourceLocation, clang::SrcMgr::CharacteristicKind, int, unsigned int)]+0x85): undefined reference to `clang::SourceManager::createFileID(clang::SrcMgr::ContentCache const*, clang::SourceLocation, clang::SrcMgr::CharacteristicKind, int, unsigned int)'<br>/tmp/cc33UrOx.o: In function `clang::Lexer::Lex(clang::Token&)':<br>aa.cpp:(.text._ZN5clang5Lexer3LexERNS_5TokenE[clang::Lexer::Lex(clang::Token&)]+0x4a): undefined reference to `clang::Lexer::LexTokenInternal(clang::Token&)'<br>/tmp/cc33UrOx.o: In function `clang::Preprocessor::Lex(clang::Token&)':<br>aa.cpp:(.text._ZN5clang12Preprocessor3LexERNS_5TokenE[clang::Preprocessor::Lex(clang::Token&)]+0x5d): undefined reference to `clang::PTHLexer::Lex(clang::Token&)'<br>aa.cpp:(.text._ZN5clang12Preprocessor3LexERNS_5TokenE[clang::Preprocessor::Lex(clang::Token&)]+0x7e): undefined reference to `clang::TokenLexer::Lex(clang::Token&)'<br>aa.cpp:(.text._ZN5clang12Preprocessor3LexERNS_5TokenE[clang::Preprocessor::Lex(clang::Token&)]+0x92): undefined reference to `clang::Preprocessor::CachingLex(clang::Token&)'<br>aa.cpp:(.text._ZN5clang12Preprocessor3LexERNS_5TokenE[clang::Preprocessor::Lex(clang::Token&)]+0xa6): undefined reference to `clang::Preprocessor::LexAfterModuleImport(clang::Token&)'<br>collect2: ld returned 1 exit status<br><br>I have checked the include file path, the lib path....<br>who can help me,thank you <br></blockquote><br></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>