[cfe-dev] Problems Building clang / llvm "examples" in Windows7 / VS2010,

arrowdodger 6yearold at gmail.com
Fri Aug 20 05:09:44 PDT 2010


I'm getting this errors too on FreeBSD with trunk llvm+clang. With any build
(configure and CMake).

On Fri, Aug 20, 2010 at 10:42 AM, Yahya H. Mirza <yahya at aurorasoft.net>wrote:

>  Hi All,
>
>
>
> I’ve been experimenting with a recent build of clang / llvm.
>
>
>
> I downloaded a new trunk following the directions from:
>
> http://clang.llvm.org/get_started.html
>
> http://wiki.llvm.org/How_do_I_compile_on_Visual_C%2B%2B%3F
>
>
>
> Below is my configuration:
>
>     Clang / LLVM Build:      111612
>
>     OS:                                   Windows7 – 32bit
>
>     Dev. Environment:       Visual Studio 2010
>
>     CMake Version:            2.8.0
>
>
>
> I can build fine without errors if I use the default configuration from the
> CMake GUI.
>
> Nevertheless, I am getting a large number of warnings (173).
>
>
>
> Additionally, when I use the CMake GUI, and when I check the flags for:
>
> ·        Clang->Examples
>
> ·        llvm->Examples
>
>
>
> I’m getting LNK2019 error (Unresolved external symbol).
>
>
>
> It’s essentially not building:
>
> ·        PrintFunctionNames.dll
>
> ·        clang-interpreter.exe
>
>
>
> Is it possible that my CMake configuration is not setup properly or perhaps
> an environment variable is not setup properly?
>
>
>
> I’ve spent a  ton of time trying to track this down, but have had no luck
> so far….
>
>
>
> I’ve also read all the posts on problems with Visual Studio 2010 due to
> Clangs lack of support for C++ 0x, but this doesn’t look like the cause
> here, but perhaps I’m wrong…..
>
>
>
> Any suggestions would be appreciated.
>
>
>
> Thanks,
>
>
>
> Yahya
>
>
>
> Below is the Visual Studio 2010 output:
>
>
>
>
> ==============================================================================================
>
>
>
> 73>------ Build started: Project: PrintFunctionNames, Configuration: Debug
> Win32 ------
>
> 73>  Building Custom Rule
> C:/llvm/tools/clang/examples/PrintFunctionNames/CMakeLists.txt
>
> 73>  CMake does not need to re-run because CMakeFiles/generate.stamp is
> up-to-date.
>
> 73>  PrintFunctionNames.cpp
>
> 63>  SelectionDAG.cpp
>
> 51>  SemaTemplateDeduction.cpp
>
> 72>     Creating library C:/llvm/llvm-vs10/lib/Debug/ModuleMaker.lib and
> object C:/llvm/llvm-vs10/lib/Debug/ModuleMaker.exp
>
> 63>  SelectionDAGBuilder.cpp
>
> 51>  SemaTemplateInstantiate.cpp
>
> 73>PrintFunctionNames.obj : error LNK2019: unresolved external symbol
> "private: void __thiscall clang::APValue::MakeUninit(void)"
> (?MakeUninit at APValue@clang@@AAEXXZ) referenced in function "public:
> __thiscall clang::APValue::~APValue(void)" (??1APValue at clang@@QAE at XZ)
>
> 73>PrintFunctionNames.obj : error LNK2001: unresolved external symbol
> "protected: virtual void __thiscall
> clang::ASTFrontendAction::ExecuteAction(void)"
> (?ExecuteAction at ASTFrontendAction@clang@@MAEXXZ)
>
> 73>PrintFunctionNames.obj : error LNK2019: unresolved external symbol
> "public: unsigned int __thiscall clang::Diagnostic::getCustomDiagID(enum
> clang::Diagnostic::Level,class llvm::StringRef)"
> (?getCustomDiagID at Diagnostic@clang@@QAEIW4Level at 12@VStringRef at llvm@@@Z)
> referenced in function "protected: virtual bool __thiscall `anonymous
> namespace'::PrintFunctionNamesAction::ParseArgs(class
> clang::CompilerInstance const &,class std::vector<class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >,class std::allocator<class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > > > const &)" (?ParseArgs at PrintFunctionNamesAction
> @?A0xce229623@@MAE_NABVCompilerInstance at clang@@ABV?$vector at V
> ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
> @V?$allocator at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@
> @std@@@2@@std@@@Z)
>
> 73>PrintFunctionNames.obj : error LNK2019: unresolved external symbol
> "class llvm::raw_ostream & __cdecl llvm::errs(void)" (?errs at llvm
> @@YAAAVraw_ostream at 1@XZ) referenced in function "protected: virtual bool
> __thiscall `anonymous namespace'::PrintFunctionNamesAction::ParseArgs(class
> clang::CompilerInstance const &,class std::vector<class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >,class std::allocator<class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > > > const &)" (?ParseArgs at PrintFunctionNamesAction
> @?A0xce229623@@MAE_NABVCompilerInstance at clang@@ABV?$vector at V
> ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
> @V?$allocator at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@
> @std@@@2@@std@@@Z)
>
> 73>PrintFunctionNames.obj : error LNK2019: unresolved external symbol
> "public: bool __thiscall clang::DiagnosticBuilder::Emit(void)"
> (?Emit at DiagnosticBuilder@clang@@QAE_NXZ) referenced in function "public:
> __thiscall clang::DiagnosticBuilder::~DiagnosticBuilder(void)"
> (??1DiagnosticBuilder at clang@@QAE at XZ)
>
> 73>PrintFunctionNames.obj : error LNK2019: unresolved external symbol
> "public: class llvm::raw_ostream & __thiscall llvm::raw_ostream::write(char
> const *,unsigned int)" (?write at raw_ostream@llvm@@QAEAAV12 at PBDI@Z)
> referenced in function "public: class llvm::raw_ostream & __thiscall
> llvm::raw_ostream::operator<<(class llvm::StringRef)" (??6raw_ostream at llvm
> @@QAEAAV01 at VStringRef@1@@Z)
>
> 73>PrintFunctionNames.obj : error LNK2001: unresolved external symbol
> "public: virtual void __thiscall
> clang::ASTConsumer::HandleInterestingDecl(class clang::DeclGroupRef)"
> (?HandleInterestingDecl at ASTConsumer@clang@@UAEXVDeclGroupRef at 2@@Z)
>
> 73>PrintFunctionNames.obj : error LNK2001: unresolved external symbol
> "public: virtual void __thiscall
> clang::ASTConsumer::HandleTopLevelDecl(class clang::DeclGroupRef)"
> (?HandleTopLevelDecl at ASTConsumer@clang@@UAEXVDeclGroupRef at 2@@Z)
>
> 73>PrintFunctionNames.obj : error LNK2019: unresolved external symbol
> "public: class std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > __thiscall
> clang::DeclarationName::getAsString(void)const "
> (?getAsString at DeclarationName@clang@@QBE?AV?$basic_string at DU
> ?$char_traits at D@std@@V?$allocator at D@2@@std@@XZ) referenced in function
> "public: class std::basic_string<char,structstd::char_traits<char>,class
> std::allocator<char> > __thiscall
> clang::NamedDecl::getNameAsString(void)const " (?getNameAsString at NamedDecl
> @clang@@QBE?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
> @XZ)
>
> 73>PrintFunctionNames.obj : error LNK2019: unresolved external symbol
> "public: __thiscall clang::FrontendAction::FrontendAction(void)"
> (??0FrontendAction at clang@@QAE at XZ) referenced in function "public:
> __thiscall clang::ASTFrontendAction::ASTFrontendAction(void)"
> (??0ASTFrontendAction at clang@@QAE at XZ)
>
> 73>PrintFunctionNames.obj : error LNK2019: unresolved external symbol
> "public: virtual __thiscall clang::FrontendAction::~FrontendAction(void)"
> (??1FrontendAction at clang@@UAE at XZ) referenced in function "public: virtual
> __thiscall clang::ASTFrontendAction::~ASTFrontendAction(void)"
> (??1ASTFrontendAction at clang@@UAE at XZ)
>
> 73>C:\AuroraSoft\Development_Projects\LLVM_Projects\llvm\llvm-vs10\lib\Debug\PrintFunctionNames.dll
> : fatal error LNK1120: 11 unresolved externals
>
>
>
>
> ==============================================================================================
>
>
>
> 85>------ Build started: Project: clang-interpreter, Configuration: Debug
> Win32 ------
>
> 86>------ Build started: Project: Fibonacci, Configuration: Debug Win32
> ------
>
> 85>  Building Custom Rule
> C:/llvm/tools/clang/examples/clang-interpreter/CMakeLists.txt
>
> 85>  CMake does not need to re-run because CMakeFiles/generate.stamp is
> up-to-date.
>
> 85>  main.cpp
>
> 86>  Building Custom Rule C:/llvm/examples/Fibonacci/CMakeLists.txt
>
> 86>  CMake does not need to re-run because CMakeFiles/generate.stamp is
> up-to-date.
>
> 86>  fibonacci.cpp
>
> 86>     Creating library C:/llvm/llvm-vs10/lib/Debug/Fibonacci.lib and
> object C:/llvm/llvm-vs10/lib/Debug/Fibonacci.exp
>
> 79>     Creating library C:/llvm/llvm-vs10/lib/Debug/libclang.lib and
> object C:/llvm/llvm-vs10/lib/Debug/libclang.exp
>
> 86>     Creating library C:/llvm/llvm-vs10/lib/Debug/Fibonacci.lib and
> object C:/llvm/llvm-vs10/lib/Debug/Fibonacci.exp
>
> 85>     Creating library C:/llvm/llvm-vs10/lib/Debug/clang-interpreter.lib
> and object C:/llvm/llvm-vs10/lib/Debug/clang-interpreter.exp
>
> 85>clangFrontend.lib(CompilerInstance.obj) : error LNK2019: unresolved
> external symbol "public: enum clang::ASTReader::ASTReadResult __thiscall
> clang::ASTReader::ReadAST(class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > const &)"
> (?ReadAST at ASTReader@clang@@QAE?AW4ASTReadResult at 12@ABV?$basic_string at DU
> ?$char_traits at D@std@@V?$allocator at D@2@@std@@@Z) referenced in function
> "public: static class clang::ExternalASTSource * __cdecl
> clang::CompilerInstance::createPCHExternalASTSource(class
> llvm::StringRef,class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > const &,bool,class
> clang::Preprocessor &,class clang::ASTContext &,void *)"
> (?createPCHExternalASTSource at CompilerInstance@clang@
> @SAPAVExternalASTSource at 2@VStringRef at llvm@@ABV?$basic_string at DU
> ?$char_traits at D@std@@V?$allocator at D@2@@std@@_NAAVPreprocessor at 2
> @AAVASTContext at 2@PAX at Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2001: unresolved external
> symbol "public: enum clang::ASTReader::ASTReadResult __thiscall
> clang::ASTReader::ReadAST(class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > const &)"
> (?ReadAST at ASTReader@clang@@QAE?AW4ASTReadResult at 12@ABV?$basic_string at DU
> ?$char_traits at D@std@@V?$allocator at D@2@@std@@@Z)
>
> 85>clangFrontend.lib(CompilerInstance.obj) : error LNK2019: unresolved
> external symbol "public: void __thiscall
> clang::ASTReader::setDeserializationListener(class
> clang::ASTDeserializationListener *)" (?setDeserializationListener at ASTReader
> @clang@@QAEXPAVASTDeserializationListener at 2@@Z) referenced in function
> "public: static class clang::ExternalASTSource * __cdecl
> clang::CompilerInstance::createPCHExternalASTSource(class
> llvm::StringRef,class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > const &,bool,class
> clang::Preprocessor &,class clang::ASTContext &,void *)"
> (?createPCHExternalASTSource at CompilerInstance@clang@
> @SAPAVExternalASTSource at 2@VStringRef at llvm@@ABV?$basic_string at DU
> ?$char_traits at D@std@@V?$allocator at D@2@@std@@_NAAVPreprocessor at 2
> @AAVASTContext at 2@PAX at Z)
>
> 85>clangFrontend.lib(CompilerInstance.obj) : error LNK2019: unresolved
> external symbol "public: __thiscall clang::ASTReader::ASTReader(class
> clang::Preprocessor &,class clang::ASTContext *,char const *,bool)"
> (??0ASTReader at clang@@QAE at AAVPreprocessor@1 at PAVASTContext@1 at PBD_N@Z)
> referenced in function "public: static class clang::ExternalASTSource *
> __cdecl clang::CompilerInstance::createPCHExternalASTSource(class
> llvm::StringRef,class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > const &,bool,class
> clang::Preprocessor &,class clang::ASTContext &,void *)"
> (?createPCHExternalASTSource at CompilerInstance@clang@
> @SAPAVExternalASTSource at 2@VStringRef at llvm@@ABV?$basic_string at DU
> ?$char_traits at D@std@@V?$allocator at D@2@@std@@_NAAVPreprocessor at 2
> @AAVASTContext at 2@PAX at Z)
>
> 85>clangFrontend.lib(CompilerInvocation.obj) : error LNK2019: unresolved
> external symbol "public: static class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > __cdecl
> clang::ASTReader::getOriginalSourceFile(class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > const &,class
> clang::Diagnostic &)" (?getOriginalSourceFile at ASTReader@clang@
> @SA?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
> @ABV34 at AAVDiagnostic@2@@Z) referenced in function "void __cdecl
> ParsePreprocessorArgs(class clang::PreprocessorOptions &,class
> clang::driver::ArgList &,class clang::Diagnostic &)"
> (?ParsePreprocessorArgs@@YAXAAVPreprocessorOptions at clang
> @@AAVArgList at driver@2 at AAVDiagnostic@2@@Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2019: unresolved external
> symbol "public: void __thiscall clang::ASTReader::InitializeContext(class
> clang::ASTContext &)" (?InitializeContext at ASTReader@clang@
> @QAEXAAVASTContext at 2@@Z) referenced in function "public: static class
> clang::ASTUnit * __cdecl clang::ASTUnit::LoadFromASTFile(class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const &,class llvm::IntrusiveRefCntPtr<class
> clang::Diagnostic>,bool,struct std::pair<class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> >,class llvm::MemoryBuffer
> const *> *,unsigned int,bool)" (?LoadFromASTFile at ASTUnit@clang@
> @SAPAV12 at ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
> @V?$IntrusiveRefCntPtr at VDiagnostic@clang@@@llvm@@_NPAU?$pair at V
> ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
> @PBVMemoryBuffer at llvm@@@4 at I2@Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2019: unresolved external
> symbol "public: void __thiscall clang::ASTReader::setPreprocessor(class
> clang::Preprocessor &)" (?setPreprocessor at ASTReader@clang@
> @QAEXAAVPreprocessor at 2@@Z) referenced in function "public: static class
> clang::ASTUnit * __cdecl clang::ASTUnit::LoadFromASTFile(class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > const &,class llvm::IntrusiveRefCntPtr<class
> clang::Diagnostic>,bool,struct std::pair<class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> >,class llvm::MemoryBuffer
> const *> *,unsigned int,bool)" (?LoadFromASTFile at ASTUnit@clang@
> @SAPAV12 at ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
> @V?$IntrusiveRefCntPtr at VDiagnostic@clang@@@llvm@@_NPAU?$pair at V
> ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
> @PBVMemoryBuffer at llvm@@@4 at I2@Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2019: unresolved external
> symbol "public: __thiscall clang::ASTReader::ASTReader(class
> clang::SourceManager &,class clang::FileManager &,class clang::Diagnostic
> &,char const *,bool)" (??0ASTReader at clang@@QAE at AAVSourceManager
> @1 at AAVFileManager@1 at AAVDiagnostic@1 at PBD_N@Z) referenced in function
> "public: static class clang::ASTUnit * __cdecl
> clang::ASTUnit::LoadFromASTFile(class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> > const &,class
> llvm::IntrusiveRefCntPtr<class clang::Diagnostic>,bool,struct
> std::pair<class std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >,class llvm::MemoryBuffer const *> *,unsigned
> int,bool)" (?LoadFromASTFile at ASTUnit@clang@@SAPAV12 at ABV?$basic_string at DU
> ?$char_traits at D@std@@V?$allocator at D@2@@std@
> @V?$IntrusiveRefCntPtr at VDiagnostic@clang@@@llvm@@_NPAU?$pair at V
> ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@
> @PBVMemoryBuffer at llvm@@@4 at I2@Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2019: unresolved external
> symbol "public: virtual __thiscall
> clang::ASTReaderListener::~ASTReaderListener(void)"
> (??1ASTReaderListener at clang@@UAE at XZ) referenced in function "public:
> virtual void * __thiscall clang::ASTReaderListener::`scalar deleting
> destructor'(unsigned int)" (??_GASTReaderListener at clang@@UAEPAXI at Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2019: unresolved external
> symbol "public: __thiscall clang::PCHGenerator::PCHGenerator(class
> clang::Preprocessor const &,bool,char const *,class llvm::raw_ostream *)"
> (??0PCHGenerator at clang@@QAE at ABVPreprocessor@1 at _NPBDPAVraw_ostream@llvm@@@Z)
> referenced in function "public: __thiscall `anonymous
> namespace'::PrecompilePreambleConsumer::PrecompilePreambleConsumer(class
> clang::ASTUnit &,class clang::Preprocessor const &,bool,char const *,class
> llvm::raw_ostream *)" (??0PrecompilePreambleConsumer@?A0x354744ea@
> @QAE at AAVASTUnit@clang@@ABVPreprocessor at 3@_NPBDPAVraw_ostream at llvm@@@Z)
>
> 85>clangFrontend.lib(FrontendActions.obj) : error LNK2001: unresolved
> external symbol "public: __thiscall clang::PCHGenerator::PCHGenerator(class
> clang::Preprocessor const &,bool,char const *,class llvm::raw_ostream *)"
> (??0PCHGenerator at clang@@QAE at ABVPreprocessor@1 at _NPBDPAVraw_ostream@llvm
> @@@Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2001: unresolved external
> symbol "public: virtual class clang::ASTDeserializationListener * __thiscall
> clang::PCHGenerator::GetASTDeserializationListener(void)"
> (?GetASTDeserializationListener at PCHGenerator@clang@
> @UAEPAVASTDeserializationListener at 2@XZ)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2019: unresolved external
> symbol "public: unsigned int __thiscall clang::ASTWriter::getDeclID(class
> clang::Decl const *)" (?getDeclID at ASTWriter@clang@@QAEIPBVDecl at 2@@Z)
> referenced in function "public: virtual void __thiscall `anonymous
> namespace'::PrecompilePreambleConsumer::HandleTranslationUnit(class
> clang::ASTContext &)" (?HandleTranslationUnit at PrecompilePreambleConsumer
> @?A0x354744ea@@UAEXAAVASTContext at clang@@@Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2019: unresolved external
> symbol "public: virtual void __thiscall
> clang::PCHGenerator::HandleTranslationUnit(class clang::ASTContext &)"
> (?HandleTranslationUnit at PCHGenerator@clang@@UAEXAAVASTContext at 2@@Z)
> referenced in function "public: virtual void __thiscall `anonymous
> namespace'::PrecompilePreambleConsumer::HandleTranslationUnit(class
> clang::ASTContext&)" (?HandleTranslationUnit at PrecompilePreambleConsumer
> @?A0x354744ea@@UAEXAAVASTContext at clang@@@Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2019: unresolved external
> symbol "public: void __thiscall clang::ASTWriter::WriteAST(class clang::Sema
> &,class clang::MemorizeStatCalls *,char const *)" (?WriteAST at ASTWriter
> @clang@@QAEXAAVSema at 2@PAVMemorizeStatCalls at 2@PBD at Z) referenced in function
> "public: bool __thiscall clang::ASTUnit::Save(class llvm::StringRef)"
> (?Save at ASTUnit@clang@@QAE_NVStringRef at llvm@@@Z)
>
> 85>clangFrontend.lib(ASTUnit.obj) : error LNK2019: unresolved external
> symbol "public: __thiscall clang::ASTWriter::ASTWriter(class
> llvm::BitstreamWriter &)" (??0ASTWriter at clang@@QAE at AAVBitstreamWriter
> @llvm@@@Z) referenced in function "public: bool __thiscall
> clang::ASTUnit::Save(class llvm::StringRef)" (?Save at ASTUnit@clang@
> @QAE_NVStringRef at llvm@@@Z)
>
> 85>C:\llvm\llvm-vs10\bin\Debug\clang-interpreter.exe : fatal error LNK1120:
> 14 unresolved externals
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100820/508513ee/attachment.html>


More information about the cfe-dev mailing list