Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to let QtCreator to HELP code "#include" ?
Forum Updated to NodeBB v4.3 + New Features

How to let QtCreator to HELP code "#include" ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 126 Views 1 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    I would like this forum to engage in discussion on HOW to utilize QtCreator to logically code #include. Yes, I mean real discussion, not just "...you been told before...' etc.

    I am NOT asking how to utilize "DOS" symbols such as "..//.."

    Here is a starting point
    When QtCreator builds project - it ends up with .pro /.cpp/.h .ui files in specific project directory.

    The "head" of .cpp will usually contain "header file " ... #include (,,,,,).h

    Here is an example:

    #include "mainwindow_Terminal_ORIGINAL.h"
    #include "ui_mainwindow_Terminal_ORIGINAL.h"
    #include "console.h"
    #include "settingsdialog.h"
    
    #include <QLabel>
    #include <QMessageBox>
    

    The subject of discussion would be
    #include "mainwindow_Terminal_ORIGINAL.h"

    The crude analysis is - the header file is on SAME level of project directory structure.

    And it can be verified by OBSERVING

    6617a64a-c2a0-4213-87c4-69b449fbf68e-image.png

    From here things are not that clear

    The "subproject" terminal is TEMPLATE = lib hence SAME header file HAS to be included in subproject where such library is used.

    ( Adding actual library may be beneficial in this discussion,,
    but I like NOT to muddle the water with more "what if" for now )

    And that is not so intuitive by just looking at "Project: view.
    The incorrect/ missing "#include" has a direct result - this error :

    make[1]: Leaving directory '/mnt/A_BT_DEC10/BT__PROGRAMS/A_MAR7_MAR15/A_BT_LIBRARY/terminal_Bluetooth'
    /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x23
    mainwindow.o: in function `MainWindow::menu_slot_indexed(int)':
    mainwindow.cpp:(.text+0x72ba): undefined reference to `MainWindow_TERMINAL_ORIGINAL::MainWindow_TERMINAL_ORIGINAL(QWidget*)'
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: Leaving directory '/mnt/A_BT_DEC10/BT__PROGRAMS/A_MAR7_MAR15/A_BT_LIBRARY/mdi'
    make[1]: *** [Makefile:293: mdi] Error 1
    make: *** [Makefile:621: sub----A_BT_LIBRARY-mdi-make_first] Error 2
    10:11:04: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project A_Mar7_MAR17 (kit: Qt 5.15.2 (gcc_64))
    When executing step "Make"
    

    The error DOES NOT show the actual source code of error (?) but it can be observed in

    "Show in editor "

    
            MainWindow_TERMINAL_ORIGINAL *MWTO = new MainWindow_TERMINAL_ORIGINAL();
    
            add_mdi_subwindow(MWTO );
    MainWindow_Bluetooth *MWB = new MainWindow_Bluetooth();
     add_mdi_subwindow(MWB );
            break;
    

    hence I consider " Show in editor" ONE of the helping tools of QtCreatror.

    The other "tools " is "Include hierarchy " view, BUT that is unclear how to utilize this tool to CORRECT and add the missing #include.

    The last , very useful tool is "intelisense" but it is NOT intuitive since it "Includes" many entries of SAME directory or actual files.

    So
    back to the title
    How to let QtCreator to HELP #include
    sub-project library header ?

    PS
    "worst case scenario" is to look for "properties" of the #include header and add FULL PATH to such file...

    PPS
    Appreciate your help to clear this confusing mess of tools and find the most logical way to "do it right" on first trial.

    Actually - old fashioned "flow chart" to
    How to let QTCreator to HELP #include ?
    would be very nice.

    1 Reply Last reply
    0

    • Login

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