Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator not recognizing linked libraries after upgrading Ubuntu to 20.04
Forum Updated to NodeBB v4.3 + New Features

QtCreator not recognizing linked libraries after upgrading Ubuntu to 20.04

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
qtcreator 4.11qt 5.12.8ubuntu 20.04
3 Posts 2 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lp2020
    wrote on 5 May 2020, 09:44 last edited by
    #1

    [Also posted on AskUbuntu without results]

    I've upgraded from Ubuntu 18.04 to 20.04 via do-release-upgrade. But my QtCreator (Qt Creator 4.11.0, Based on Qt 5.12.8 (GCC 9.3.0, 64 bit), installed from the Ubuntu repositoies) is facing problems recognizing included libraries. It's showing hundreds of error messages in projects that have worked perfectly fine before the update. The error messages all look like linker error messages. Some examples:

     error: 'std::string' (aka 'int') is not a class, namespace, or enumeration
     error: no matching function for call to 'getline'
     error: member reference base type 'std::ifstream' (aka 'int') is not a structure or union
     error: no template named 'vector' in namespace 'std'
     error: unknown type name 'SystemCallFactory' //this class is from the same  project
    

    And even some errors in the qt and std libraries:

    /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:1374: passing argument to parameter 's' here 
    /usr/include/c++/8/ostream:41: candidate found by name lookup is 'std'
    
    • The problem occurs in both cmake and qmake projects
    • I do have (and need) different gcc and g++ versions installed (9 and 8) (reinstalled both after the update as the update-alternatives settings were broken and one dependency was upgraded from 6 to 8)

    update-alternatives --display gcc
    gcc - auto mode
    link best version is /usr/bin/gcc-8
    link currently points to /usr/bin/gcc-8
    link gcc is /usr/bin/gcc
    /usr/bin/gcc-8 - priority 30
    /usr/bin/gcc-9 - priority 20

    update-alternatives --display g++
    g++ - auto mode
    link best version is /usr/bin/g++-8
    link currently points to /usr/bin/g++-8
    link g++ is /usr/bin/g++
    /usr/bin/g++-8 - priority 30
    /usr/bin/g++-9 - priority 20

    When I create a new project in QtCreator without changing anything from the default code, it's the same:

    /home/$me/src/untitled/main.cpp:7: error: variable has incomplete type 'QApplication'`
    /home/$me/src/untitled/main.cpp:8: error: unknown type name 'MainWindow'
    

    I can still build all projects manually, again both cmake and qmake work here, with the exact same commands that are stored in the QtCreator build section. Also, when I have a complete build in the build directory that's set in QtCreator, QtCreator will build my projects, even when I change something. It will still show the errors all over my code and in the issues section, but will build and run anyways, so the build commands should be fine. But when the build directory is empty, it will fail.
    How can I approach this problem further?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 5 May 2020, 18:34 last edited by
      #2

      Hi and welcome to devnet,

      Did you try to nuke the Qt Creator settings ? Well rather move the settings folder somewhere else and start Qt Creator ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • L Offline
        L Offline
        lp2020
        wrote on 5 May 2020, 21:39 last edited by
        #3

        Thank you!
        No, partly because the QtSettings are a bit scattered and I wasn't shure which ones would be correct.

        Removing and reinstalling QtCreator from Ubuntu repos didn't work, but removing and installing it via the QtUnified online installer did. Was hoping to avoid that because I didn't want to log in with an account but gave up eventually. I may try to switch back with cleaned settings at one point, but for now I'm just glad it works again.

        1 Reply Last reply
        0

        1/3

        5 May 2020, 09:44

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved