cpp_clang.cpp:(.text+0x4d1): undefined reference to `llvm::vfs::getRealFileSystem()'
Unsolved
Qt 6
-
Hi, all:
I'm working under
Ubuntu 22.04
,➜ build lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy ➜ build gcc --version gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I failed to build Qt6 with the following ERROR messages . It looks the faults are related to LLVM ???
So, my questions:
- To build
Qt6
, must I useclang
rather thangcc
? - How come
Qt6
got anERROR
related tollvm::vfs
???
I actually failed to build
qttools
, which in the end, let me remove 3 packages out from building:qttools
qtdoc
qttranslations
and, I did find the connection between
qt6
andllvm
, out of my expectation. I've been thinking even the tools,qt6
itself should have NOTHING to do withllvm
. These two packages should have NO dependency relationship.➜ qttools grep -rwn "llvm" configure.cmake:120:Either set CMAKE_PREFIX_PATH or LLVM_INSTALL_DIR to the location of your llvm installation. configure.cmake:122:On macOS, you can use Homebrew's llvm package. tests/auto/qdoc/catch/catch.hpp:339: // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 src/linguist/lupdate/lupdatepreprocessoraction.cpp:19: llvm::StringRef fileName = sm.getFilename(sourceRange.getBegin()); src/linguist/lupdate/lupdatepreprocessoraction.cpp:138: llvm::StringRef fileName = sm.getFilename(sourceRange.getBegin()); src/linguist/lupdate/lupdatepreprocessoraction.cpp:145: llvm::StringRef skippedText = llvm::StringRef(begin, end - begin); src/linguist/lupdate/clangtoolastreader.h:97: clang::CompilerInstance &compiler, llvm::StringRef /* inFile */) override src/linguist/lupdate/cpp_clang.cpp:246: return [=](const clang::tooling::CommandLineArguments &args, llvm::StringRef /*unused*/) { src/linguist/lupdate/cpp_clang.cpp:275: clang::tooling::CommandLineArguments::iterator it = llvm::find(adjustedArgs, "--"); src/linguist/lupdate/cpp_clang.cpp:281:bool ClangCppParser::stringContainsTranslationInformation(llvm::StringRef ba) src/linguist/lupdate/cpp_clang.cpp:285: constexpr llvm::StringLiteral qDeclareTrFunction("Q_DECLARE_TR_FUNCTIONS("); src/linguist/lupdate/cpp_clang.cpp:286: constexpr llvm::StringLiteral qtTrNoop("QT_TR_NOOP("); src/linguist/lupdate/cpp_clang.cpp:287: constexpr llvm::StringLiteral qtTrNoopUTF8("QT_TR_NOOP)UTF8("); src/linguist/lupdate/cpp_clang.cpp:288: constexpr llvm::StringLiteral qtTrNNoop("QT_TR_N_NOOP("); src/linguist/lupdate/cpp_clang.cpp:289: constexpr llvm::StringLiteral qtTrIdNoop("QT_TRID_NOOP("); src/linguist/lupdate/cpp_clang.cpp:290: constexpr llvm::StringLiteral qtTrIdNNoop("QT_TRID_N_NOOP("); src/linguist/lupdate/cpp_clang.cpp:291: constexpr llvm::StringLiteral qtTranslateNoop("QT_TRANSLATE_NOOP("); src/linguist/lupdate/cpp_clang.cpp:292: constexpr llvm::StringLiteral qtTranslateNoopUTF8("QT_TRANSLATE_NOOP_UTF8("); src/linguist/lupdate/cpp_clang.cpp:293: constexpr llvm::StringLiteral qtTranslateNNoop("QT_TRANSLATE_N_NOOP("); src/linguist/lupdate/cpp_clang.cpp:294: constexpr llvm::StringLiteral qtTranslateNoop3("QT_TRANSLATE_NOOP3("); src/linguist/lupdate/cpp_clang.cpp:295: constexpr llvm::StringLiteral qtTranslateNoop3UTF8("QT_TRANSLATE_NOOP3_UTF8("); src/linguist/lupdate/cpp_clang.cpp:296: constexpr llvm::StringLiteral qtTranslateNNoop3("QT_TRANSLATE_N_NOOP3("); src/linguist/lupdate/cpp_clang.cpp:297: constexpr llvm::StringLiteral translatorComment("TRANSLATOR "); src/linguist/lupdate/cpp_clang.cpp:298: constexpr llvm::StringLiteral qtTrId("qtTrId("); src/linguist/lupdate/cpp_clang.cpp:299: constexpr llvm::StringLiteral tr("tr("); src/linguist/lupdate/cpp_clang.cpp:300: constexpr llvm::StringLiteral trUtf8("trUtf8("); src/linguist/lupdate/cpp_clang.cpp:301: constexpr llvm::StringLiteral translate("translate("); src/linguist/lupdate/cpp_clang.cpp:304: const auto baSliced = ba.slice(pos, llvm::StringRef::npos); src/linguist/lupdate/cpp_clang.cpp:305: if (pos != llvm::StringRef::npos) { src/linguist/lupdate/clangtoolastreader.cpp:24: clang::StringLiteral *stringLit = llvm::dyn_cast_or_null<clang::StringLiteral>(child); src/linguist/lupdate/clangtoolastreader.cpp:53: clang::AccessSpecDecl *accessSpec = llvm::dyn_cast<clang::AccessSpecDecl>(decl); src/linguist/lupdate/clangtoolastreader.cpp:54: clang::CXXMethodDecl *method = llvm::dyn_cast<clang::CXXMethodDecl>(decl); src/linguist/lupdate/clangtoolastreader.cpp:161: clang::CXXRecordDecl *recordDecl = llvm::dyn_cast<clang::CXXRecordDecl>(decl); src/linguist/lupdate/clangtoolastreader.cpp:195: llvm::raw_string_ostream tmp(context); src/linguist/lupdate/clangtoolastreader.cpp:220: bool hasQuote(llvm::StringRef source) src/linguist/lupdate/clangtoolastreader.cpp:225: bool trFunctionPresent(llvm::StringRef text) src/linguist/lupdate/clangtoolastreader.cpp:227: if (text.contains(llvm::StringRef("qtTrId("))) src/linguist/lupdate/clangtoolastreader.cpp:229: if (text.contains(llvm::StringRef("tr("))) src/linguist/lupdate/clangtoolastreader.cpp:231: if (text.contains(llvm::StringRef("trUtf8("))) src/linguist/lupdate/clangtoolastreader.cpp:233: if (text.contains(llvm::StringRef("translate("))) src/linguist/lupdate/clangtoolastreader.cpp:235: if (text.contains(llvm::StringRef("Q_DECLARE_TR_FUNCTIONS("))) src/linguist/lupdate/clangtoolastreader.cpp:237: if (text.contains(llvm::StringRef("QT_TR_N_NOOP("))) src/linguist/lupdate/clangtoolastreader.cpp:239: if (text.contains(llvm::StringRef("QT_TRID_N_NOOP("))) src/linguist/lupdate/clangtoolastreader.cpp:241: if (text.contains(llvm::StringRef("QT_TRANSLATE_N_NOOP("))) src/linguist/lupdate/clangtoolastreader.cpp:243: if (text.contains(llvm::StringRef("QT_TRANSLATE_N_NOOP3("))) src/linguist/lupdate/clangtoolastreader.cpp:245: if (text.contains(llvm::StringRef("QT_TR_NOOP("))) src/linguist/lupdate/clangtoolastreader.cpp:247: if (text.contains(llvm::StringRef("QT_TRID_NOOP("))) src/linguist/lupdate/clangtoolastreader.cpp:249: if (text.contains(llvm::StringRef("QT_TRANSLATE_NOOP("))) src/linguist/lupdate/clangtoolastreader.cpp:251: if (text.contains(llvm::StringRef("QT_TRANSLATE_NOOP3("))) src/linguist/lupdate/clangtoolastreader.cpp:253: if (text.contains(llvm::StringRef("QT_TR_NOOP_UTF8("))) src/linguist/lupdate/clangtoolastreader.cpp:255: if (text.contains(llvm::StringRef("QT_TRANSLATE_NOOP_UTF8("))) src/linguist/lupdate/clangtoolastreader.cpp:257: if (text.contains(llvm::StringRef("QT_TRANSLATE_NOOP3_UTF8("))) src/linguist/lupdate/clangtoolastreader.cpp:370: llvm::raw_string_ostream temp(arguments[i]); src/linguist/lupdate/clangtoolastreader.cpp:564: llvm::StringRef text(buffer + commentEndDecomp.second, src/linguist/lupdate/clangtoolastreader.cpp:569: if (text.find_first_of(";}#@") != llvm::StringRef::npos) { src/linguist/lupdate/clangtoolastreader.cpp:574: if (sameLineComment && text.find_first_of(",") != llvm::StringRef::npos) { src/linguist/lupdate/cpp_clang.h:21:#include <llvm/ADT/StringRef.h> src/linguist/lupdate/cpp_clang.h:36:inline QString toQt(llvm::StringRef str) src/linguist/lupdate/cpp_clang.h:245: inline QString cleanQuote(llvm::StringRef s, QuoteCompulsary quote) src/linguist/lupdate/cpp_clang.h:308: bool stringContainsTranslationInformation(llvm::StringRef ba); src/qdoc/clangcodeparser.cpp:988: // llvm to expose some of the C++ API methods that would src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc:23: \note \l{QDoc Manual}{QDoc} requires \l{http://clang.llvm.org}{Clang} src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc:641: \l {https://llvm.org/}{the LLVM Compiler Infrastructure Project}. src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc:643: \l{http://clang.llvm.org}{Clang 8.0} or later. src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc:659: \l{https://formulae.brew.sh/formula/llvm}{llvm formula}. src/qdoc/doc/qdoc-guide/qdoc-guide.qdoc:662: \note the prebuilt binaries from \l{http://releases.llvm.org/download.html} src/assistant/qlitehtml/.clang-format:14:# [2] https://clang.llvm.org/docs/ClangFormatStyleOptions.html
Anyway.... Now, successfully built after removing the above 3 packages from building.
Well, of course, don't forget to NOT use the to-be-deprecatedFileDescriptor::SYNTAX_PROTO3
:/*** going to be deprecated. if (file->syntax() != FileDescriptor::SYNTAX_PROTO3) { *error = "Invalid proto used. qtprotobufgen only supports 'proto3' syntax"; return false; } ***/
Cheers
- To build