Re: clang_parseTransitionUnit2 gives error

Milian Wolff <[email protected]> Mon, 11 Apr 2022 09:31:29 +0200
Newsgroups gmane.comp.kde.devel.kdevelop
Message-ID <7820035.uftPRqqyHn@milian-workstation>
On Sonntag, 10. April 2022 19:30:25 CEST Enes Albay wrote:
> Thanks for your quick response Sven,
> 
> I forgot to mention that KDEV_CLANG_DISPLAY_DIAGS does not help much. It
> gives the following error with KDEV_CLANG_DISPLAY_DIAGS

<snip>

> kdevelop.plugins.clang: Failed to parse translation unit:
> "/media/enes/MyFiles/programming/cpp/cmakeExamples/ex1/main.cpp"
> kdevelop.plugins.clang: clang_parseTranslationUnit2 return with error code

Can you share this `main.cpp` file with us - or maybe the whole project if 
possible? Also, please set KDEV_CLANG_DISPLAY_ARGS=1 and 
KDEV_CLANG_DISPLAY_DEFINES=1, then we would see everything that is getting 
passed to clang.

Cheers

> On Sun, Apr 10, 2022 at 8:03 PM Sven Brauch <mail-ITmcY+a7/[email protected]> wrote:
> > Hi, as a first step I'd try setting KDEV_CLANG_DISPLAY_DIAGS=1 as
> > recommended by the error message. That will show you details on the
> > error on console, maybe it is clear then what happens.
> > 
> > Greetings!
> > 
> > On 4/10/22 18:37, Enes Albay wrote:
> > > Hi all,
> > > 
> > > I built kdevelop using kdesrc-build according to instructions on the
> > > website (https://community.kde.org/KDevelop/HowToCompile_v5
> > > <https://community.kde.org/KDevelop/HowToCompile_v5>). When I run
> > > kdevelop, I get the following clang error. Source code navigation does
> > > not work properly. I wrote a simple program to test the
> > > clang_parseTransitionUnit2 function. It works without any problem. But
> > > clang plugin gives errors in kdevelop because of
> > 
> > clang_parseTransitionUnit2.
> > 
> > > Do you have any experience with this error?
> > > 
> > > I am working on debian bullseye with kernel 5.10.0-13-amd64 #1 SMP
> > > Debian 5.10.106-1 (2022-03-17) x86_64 GNU/Linux
> > > 
> > > Clang version is
> > > 
> > > kde/build/kdevelop/bin$ clang --version
> > > Debian clang version 11.0.1-2
> > > Target: x86_64-pc-linux-gnu
> > > Thread model: posix
> > > InstalledDir: /usr/bin
> > > 
> > > kde/build/kdevelop/bin$ ./kdevelop
> > > kdevplatform.serialization: "The data-repository at
> > 
> > /home/enes/.cache/kdevduchain/kdevelop-{2e78e62c-8b7d-4277-a699-d586b7b066
> > c3}> 
> > > has to be cleared."
> > > Qt WebEngine seems to be initialized from a plugin. Please set
> > > Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before
> > > constructing QGuiApplication.
> > > kf.kio.slaves.file: copy()
> > 
> > QUrl("file:///media/enes/MyFiles/programming/cpp/cmakeExamples/ex1/ex1.kde
> > v4")> 
> > > to QUrl("file:///tmp/kdevelop.shLcdo") mode= -1
> > > kf.kio.slaves.file: the file doesn't have any xattr
> > > qrc:/qml/area_code.qml:56:9: Type NewsFeed unavailable
> > > qrc:/qml/NewsFeed.qml:10:1: module "QtQuick.XmlListModel" is not
> > 
> > installed
> > 
> > > kdevelop.plugins.clang: clang_parseTranslationUnit2 return with error
> > > code 4
> > > kdevelop.plugins.clang:   (start KDevelop with
> > > `KDEV_CLANG_DISPLAY_DIAGS=1 kdevelop` to see more diagnostics)
> > > kdevelop.plugins.clang: Failed to parse translation unit:
> > > "/media/enes/MyFiles/programming/cpp/cmakeExamples/ex1/main.cpp"
> > > kdevelop.plugins.clang: clang_parseTranslationUnit2 return with error
> > > code 4
> > > kdevelop.plugins.clang:   (start KDevelop with
> > > `KDEV_CLANG_DISPLAY_DIAGS=1 kdevelop` to see more diagnostics)
> > 
> > > kdevelop.plugins.clang: Failed to parse translation unit:
> > "/media/enes/MyFiles/programming/cpp/cmakeExamples/ex1/build/CMakeFiles/3.
> > 18.4/CompilerIdCXX/CMakeCXXCompilerId.cpp"> 
> > > kdevelop.plugins.clang: clang_parseTranslationUnit2 return with error
> > > code 4
> > > kdevelop.plugins.clang:   (start KDevelop with
> > > `KDEV_CLANG_DISPLAY_DIAGS=1 kdevelop` to see more diagnostics)
> > 
> > > kdevelop.plugins.clang: Failed to parse translation unit:
> > "/media/enes/MyFiles/programming/cpp/cmakeExamples/ex1/build/CMakeFiles/3.
> > 18.4/CompilerIdC/CMakeCCompilerId.c"> 
> > > --
> > > Enes


-- 
Milian Wolff
[email protected]
http://milianw.de
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEezawi1aUvUGg3A1+8zYW/HGdOX8FAmJT2VEACgkQ8zYW/HGd
OX969Q//URlGmiWLjkd503A9ktu+lS4pZhdEzamukY1+B6nZXcn7lRIGGMeT+JoD
osW3FdWWWXfBn4pMVqqUoOnMWJQ/IwLMUtcHezz41+7Q2Pt785YYFBABqWTJE4UR
tPteP18sX5jRofzvoHr4ARU1QQrH1wPTxBz+0lY9YwRg/2T9azoaEKjzysGaMHA9
OS13uu+m21ORdzwpJQWT5ALbEoyj4uUlQAMQaTLHrJoY7xbqL248hFYBGKlOK8Ns
a1Juiu8mIoqqpLzvDzkDwuSfKotsaXJ/33lHoRnMi5v6XPd8aqQ2u2zvLWkIdYUZ
Bz7Kk+DLf+lCuTgffKMoPqUWBsQ2XsIkbltAYSzQ111tzWWPw3s6zA1ZHqQ+RzLV
kZfBYb+87KJlLkTX2uMA0ROkHLwzxcPTl9lVHxb+5AdXLYXfalO21f7C4Coct9iD
UwaxtD67QM1Q9b0jCrsoZ9oa2yYF4gfdKg3B4VKmLZAvdZl+PMdTzvd3wII3OvIi
KOveP2tR93ANjciv/O45VoZ7lXpN31RfHHBOyVhkkGaAJFinpJRp+h2Wr5oJNtdN
mov6CDD8K7598C0/8iYRObdqXlLxz2tDWHtnxh605Z8hUjHm/60L7c4fgsGYu/VO
Joscx8PINjGnlO9DoCvgp6JN/2r8KjR/ckbiZBF7NSplXVYYgDA=
=SSB4
-----END PGP SIGNATURE-----