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. Undefined reference - again - discussion
QtWS25 Last Chance

Undefined reference - again - discussion

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
18 Posts 4 Posters 1.4k Views
  • 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 Anonymous_Banned275
    4 Apr 2024, 14:58

    MORE ADDENDUM

    Is this red / green line thru #67 - #74 an error indicator ?

    For sake of discussion - I will make an exception and ask for reference to Qt document (RTFM)....

    feaa156d-f0dd-4953-a730-4a9d576d1a9b-image.png

    ADDENDUM

    Is this just a confirmation of the issue and not really more help info ?

    There is only ONE MainWindow in the project and it really does not point to source of the problem, but to the "result" object file.

    Am I correct ?

    I have deleted all optional sources from the .pro file, same issue.

    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::MainWindow()': mainwindow.cpp:(.text+0x1c8): undefined reference to terminal_ORIGINAL_MainWindow::terminal_ORIGINAL_MainWindow(QWidget*)'
    /usr/bin/ld: mainwindow.cpp:(.text+0x1e7): undefined reference to `terminal_ORIGINAL_MainWindow::terminal_ORIGINAL_MainWindow(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:595: sub----A_BT_LIBRARY-mdi-make_first] Error 2
    10:13:15: 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"

    Undefined reference - again - discussion
    help me to improve debugging process.

    I am posting this to get some MORE ideas how to find the code problem.

    Currently I have the class in question added to my "parent class" header :

    public:
    terminal_ORIGINAL_MainWindow *pTOMW;:

    there is no indication of error there

    I have added this code to my parent constructor :

    terminal_ORIGINAL_MainWindow *p = new terminal_ORIGINAL_MainWindow();
    p->show();
    
    pTOMW = new terminal_ORIGINAL_MainWindow();
    pTOMW->show();
    

    There is no indication of error there.

    The class in question runs just as expected when
    I change the TEMPLATE in .pro to app, BUT fails when the TEMPLATE is set to library.

    The compiler builds the library and the there ARE NO missing headers.

    The intelisense has NO ISSUES suggesting the code options when editing - hence there is a valid reference for intelisense to work as expected.

    Yes, the correct library was added to parent class.
    Yes, I have similary modified class / project added to my subprojects and it works as expected.

    Hence i HAVE , OBVIOUSLY, missed something when duplicating SAME Qt example. ( No need to confirm that...)

    In an essence - the code works as an independent project, but fails to work when added to subdir project.

    I am asking for help trying some other ways to identify the missing code.

    I was ho[ping I try to find some way to compare the working code with the failing one, perhaps file by file...

    I am NOT asking for RTFM or actual code , I am asking for help to improve debugging process.

    4aa197b5-17b7-428b-ad71-4ef753a508d8-image.png

    /mnt/A_BT_DEC10/BT__PROGRAMS/A_MAR7_MAR15/A_BT_LIBRARY/mdi/mainwindow.cpp:-1: error: undefined reference to `terminal_ORIGINAL_MainWindow::terminal_ORIGINAL_MainWindow(QWidget*)'

    PS
    Need more info ? ASK

    J Offline
    J Offline
    J.Hilk
    Moderators
    wrote on 5 Apr 2024, 06:12 last edited by
    #6

    @AnneRanch said in Undefined reference - again - discussion:

    I change the TEMPLATE in .pro to app, BUT fails when the TEMPLATE is set to library.

    this might be the crux of the problem, did you do that previously to the error appearing as well ?

    The build system usually doesn't rebuild object files on its own, if there are no changes in the source files. But changing from standalone app to library does require different object files.

    this is for example one of the reasons, why shadow build folders in QtCreator have the QtVersion/Compiler in its name. To not mix obj files created.


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    A 1 Reply Last reply 5 Apr 2024, 12:47
    1
    • J J.Hilk
      5 Apr 2024, 06:12

      @AnneRanch said in Undefined reference - again - discussion:

      I change the TEMPLATE in .pro to app, BUT fails when the TEMPLATE is set to library.

      this might be the crux of the problem, did you do that previously to the error appearing as well ?

      The build system usually doesn't rebuild object files on its own, if there are no changes in the source files. But changing from standalone app to library does require different object files.

      this is for example one of the reasons, why shadow build folders in QtCreator have the QtVersion/Compiler in its name. To not mix obj files created.

      A Offline
      A Offline
      Anonymous_Banned275
      wrote on 5 Apr 2024, 12:47 last edited by
      #7

      @J-Hilk I am using changing the TEMPLATE as debugging tool.
      In my case just to make sure the code works / runs independent of library usage.
      I actually have two copies of the "problem
      " source code - one in subdirs project and one as an independent project.

      Mainly because when I change the template to app , I cannot "run" the problem code , the main subdirs project does not like "two" main apps.

      BTW

      I think the problem is in "mixing " include and actual link to the .so code - I am going to verify all of the next.

      A 1 Reply Last reply 5 Apr 2024, 14:46
      0
      • A Anonymous_Banned275
        5 Apr 2024, 12:47

        @J-Hilk I am using changing the TEMPLATE as debugging tool.
        In my case just to make sure the code works / runs independent of library usage.
        I actually have two copies of the "problem
        " source code - one in subdirs project and one as an independent project.

        Mainly because when I change the template to app , I cannot "run" the problem code , the main subdirs project does not like "two" main apps.

        BTW

        I think the problem is in "mixing " include and actual link to the .so code - I am going to verify all of the next.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on 5 Apr 2024, 14:46 last edited by
        #8

        @AnneRanch OK, here is complier / linker output AFTER the TEMPLATE = lib

        09:31:01: Running steps for project terminal...
        09:31:01: Starting: "/home/nov25-1/Qt/5.15.2/gcc_64/bin/qmake" /mnt/A_BT_DEC10/BT__PROGRAMS/A_MAR7_MAR15/A_BT_LIBRARY/CCC_SOURCE/TERMINAL_example_source/terminal/terminal.pro -spec linux-clang CONFIG+=debug CONFIG+=qml_debug
        Project MESSAGE: RESTOREd ALL resouces - DEBUG commneted out options resouces - same issue
        Project MESSAGE: Changed back to TEMPLATE = lib
        /mnt/A_BT_DEC10/BT__PROGRAMS/A_MAR7_MAR15/A_BT_LIBRARY/CCC_SOURCE/TERMINAL_example_source/terminal/terminal.pro:36: message(message) requires one argument.
        Project MESSAGE:
        09:31:01: The process "/home/nov25-1/Qt/5.15.2/gcc_64/bin/qmake" exited normally.

        09:31:01: Starting: "/usr/bin/make" -f /mnt/A_BT_DEC10/BT__PROGRAMS/A_MAR7_MAR15/A_BT_LIBRARY/CCC_SOURCE/TERMINAL_example_source/terminal/Makefile qmake_all
        make: Nothing to be done for 'qmake_all'.
        09:31:01: The process "/usr/bin/make" exited normally.

        09:31:01: Starting: "/usr/bin/make" -j4
        rm -f libterminal.so.1.0.0 libterminal.so libterminal.so.1 libterminal.so.1.0
        clang++ -ccc-gcc-name g++ -Wl,-rpath,/home/nov25-1/Qt/5.15.2/gcc_64/lib -shared -Wl,-soname,libterminal.so.1 -o libterminal.so.1.0.0 main.o settingsdialog.o console.o terminal_ORIGINAL_mainwindow.o qrc_terminal.o moc_settingsdialog.o moc_console.o moc_terminal_ORIGINAL_mainwindow.o /home/nov25-1/Qt/5.15.2/gcc_64/lib/libQt5Widgets.so

        /home/nov25-1/Qt/5.15.2/gcc_64/lib/libQt5Gui.so /home/nov25-1/Qt/5.15.2/gcc_64/lib/libQt5SerialPort.so /home/nov25-1/Qt/5.15.2/gcc_64/lib/libQt5Core.so -lGL -lpthread
        ln -s libterminal.so.1.0.0 libterminal.so
        ln -s libterminal.so.1.0.0 libterminal.so.1
        ln -s libterminal.so.1.0.0 libterminal.so.1.0
        09:31:03: The process "/usr/bin/make" exited normally.
        09:31:03: Elapsed time: 00:02.

        1.Does THIS output help me to ADD correct #include header to the "parent " class ?

        2.Does THIS output help me to ADD correct "library" to the "parent " class ?

        Using "Add library" option - internal or external or ...

        A 1 Reply Last reply 5 Apr 2024, 17:17
        0
        • A Anonymous_Banned275
          5 Apr 2024, 14:46

          @AnneRanch OK, here is complier / linker output AFTER the TEMPLATE = lib

          09:31:01: Running steps for project terminal...
          09:31:01: Starting: "/home/nov25-1/Qt/5.15.2/gcc_64/bin/qmake" /mnt/A_BT_DEC10/BT__PROGRAMS/A_MAR7_MAR15/A_BT_LIBRARY/CCC_SOURCE/TERMINAL_example_source/terminal/terminal.pro -spec linux-clang CONFIG+=debug CONFIG+=qml_debug
          Project MESSAGE: RESTOREd ALL resouces - DEBUG commneted out options resouces - same issue
          Project MESSAGE: Changed back to TEMPLATE = lib
          /mnt/A_BT_DEC10/BT__PROGRAMS/A_MAR7_MAR15/A_BT_LIBRARY/CCC_SOURCE/TERMINAL_example_source/terminal/terminal.pro:36: message(message) requires one argument.
          Project MESSAGE:
          09:31:01: The process "/home/nov25-1/Qt/5.15.2/gcc_64/bin/qmake" exited normally.

          09:31:01: Starting: "/usr/bin/make" -f /mnt/A_BT_DEC10/BT__PROGRAMS/A_MAR7_MAR15/A_BT_LIBRARY/CCC_SOURCE/TERMINAL_example_source/terminal/Makefile qmake_all
          make: Nothing to be done for 'qmake_all'.
          09:31:01: The process "/usr/bin/make" exited normally.

          09:31:01: Starting: "/usr/bin/make" -j4
          rm -f libterminal.so.1.0.0 libterminal.so libterminal.so.1 libterminal.so.1.0
          clang++ -ccc-gcc-name g++ -Wl,-rpath,/home/nov25-1/Qt/5.15.2/gcc_64/lib -shared -Wl,-soname,libterminal.so.1 -o libterminal.so.1.0.0 main.o settingsdialog.o console.o terminal_ORIGINAL_mainwindow.o qrc_terminal.o moc_settingsdialog.o moc_console.o moc_terminal_ORIGINAL_mainwindow.o /home/nov25-1/Qt/5.15.2/gcc_64/lib/libQt5Widgets.so

          /home/nov25-1/Qt/5.15.2/gcc_64/lib/libQt5Gui.so /home/nov25-1/Qt/5.15.2/gcc_64/lib/libQt5SerialPort.so /home/nov25-1/Qt/5.15.2/gcc_64/lib/libQt5Core.so -lGL -lpthread
          ln -s libterminal.so.1.0.0 libterminal.so
          ln -s libterminal.so.1.0.0 libterminal.so.1
          ln -s libterminal.so.1.0.0 libterminal.so.1.0
          09:31:03: The process "/usr/bin/make" exited normally.
          09:31:03: Elapsed time: 00:02.

          1.Does THIS output help me to ADD correct #include header to the "parent " class ?

          2.Does THIS output help me to ADD correct "library" to the "parent " class ?

          Using "Add library" option - internal or external or ...

          A Offline
          A Offline
          Anonymous_Banned275
          wrote on 5 Apr 2024, 17:17 last edited by
          #9

          @AnneRanch

          After
          changing the #include to

          #include < header file >

          adding library using "external " with full path

          I still get same , agree this is a linker, error pointing to here:

              // TEST_SUBPROJECT
              text = " TEMPORARY WINDOW TITLE CHANGED index 40 ...";
              TEST_PROJECT_MainWindow *pTEST_INDEX = new TEST_PROJECT_MainWindow();
              pTEST_INDEX->setWindowTitle(text);
              add_mdi_subwindow (pTEST_INDEX);
          
              // debug terminal issue
          
           This code fails but there is no compiler error indicated
          
          
              **terminal_ORIGINAL_MainWindow *pTERMINAL = new terminal_ORIGINAL_MainWindow();
              add_mdi_subwindow (pTERMINAL);**
          
           This code fails but there is no compiler indicated
          
          J 1 Reply Last reply 5 Apr 2024, 17:21
          0
          • A Anonymous_Banned275
            5 Apr 2024, 17:17

            @AnneRanch

            After
            changing the #include to

            #include < header file >

            adding library using "external " with full path

            I still get same , agree this is a linker, error pointing to here:

                // TEST_SUBPROJECT
                text = " TEMPORARY WINDOW TITLE CHANGED index 40 ...";
                TEST_PROJECT_MainWindow *pTEST_INDEX = new TEST_PROJECT_MainWindow();
                pTEST_INDEX->setWindowTitle(text);
                add_mdi_subwindow (pTEST_INDEX);
            
                // debug terminal issue
            
             This code fails but there is no compiler error indicated
            
            
                **terminal_ORIGINAL_MainWindow *pTERMINAL = new terminal_ORIGINAL_MainWindow();
                add_mdi_subwindow (pTERMINAL);**
            
             This code fails but there is no compiler indicated
            
            J Offline
            J Offline
            JonB
            wrote on 5 Apr 2024, 17:21 last edited by JonB 4 May 2024, 17:28
            #10

            @AnneRanch said in Undefined reference - again - discussion:

            This code fails but there is no compiler error indicated

            That is because it is a linker error. You told the compiler that there is a terminal_ORIGINAL_MainWindow class in another file, but you did not link with terminal_ORIGINAL_MainWindow.o , which you need to do as it has the class code, so the linker could not succeed.

            If you had not #included the terminal_ORIGINAL_MainWindow.h file THAT would have given a compilation error on the new terminal_ORIGINAL_MainWindow() line. But including that allows it to compile, and says the terminal_ORIGINAL_MainWindow.o object file will be provided at link time. But, for whatever reason, it is not when you get your error.

            That is what the Undefined reference error message from linker (ld) indicates each time.

            A 2 Replies Last reply 7 Apr 2024, 17:26
            0
            • J JonB
              5 Apr 2024, 17:21

              @AnneRanch said in Undefined reference - again - discussion:

              This code fails but there is no compiler error indicated

              That is because it is a linker error. You told the compiler that there is a terminal_ORIGINAL_MainWindow class in another file, but you did not link with terminal_ORIGINAL_MainWindow.o , which you need to do as it has the class code, so the linker could not succeed.

              If you had not #included the terminal_ORIGINAL_MainWindow.h file THAT would have given a compilation error on the new terminal_ORIGINAL_MainWindow() line. But including that allows it to compile, and says the terminal_ORIGINAL_MainWindow.o object file will be provided at link time. But, for whatever reason, it is not when you get your error.

              That is what the Undefined reference error message from linker (ld) indicates each time.

              A Offline
              A Offline
              Anonymous_Banned275
              wrote on 7 Apr 2024, 17:26 last edited by
              #11
              This post is deleted!
              1 Reply Last reply
              0
              • A Offline
                A Offline
                Anonymous_Banned275
                wrote on 8 Apr 2024, 11:06 last edited by Anonymous_Banned275 4 Aug 2024, 11:10
                #12

                UPDATE

                I have given up trying to physically find the "linker" problem.
                I am trying a DIFFERENT way to resolve this AND could use some help.

                I now have TWO "subdirs" projects - my main one , the one which refuses to work , and working "helper project".

                The "helper project" works as expected - here is the result:

                41b23c80-a94c-42ef-8716-3a4b2602ab9b-image.png

                ![2c014c03-91ca-4ba5-ae24-cf8f36e7d9c3-image.png](https://ddgobkiprc33d.cloudfront.net/e8891de0-f237-4934-894d-ed0fc54abae2.png

                As "subdirs" , the "helper project" has main .pro and terminal .pro.

                I repeat - the "terminal" helper project works BY ITSELF as expected.

                I have successfully added the "helper project " to my main project. - "TEST_MAIN_SUBPROJECT "

                Here is the picture of ALL .pro files in it:

                f34e3ce7-7b94-40a5-b026-07f4a6c6004a-image.png

                HERE IS WHAT I NEED HELP WITH
                Currently the TEST_MAIN_SUBPROJECT runs
                TERMINAL_SUBDIRS_PROJECT "MAIN_PROJECT" - as posted at the start of this post.

                I need to SWITCH it to run

                A_Mar7_MAR17.pro

                the original , faulty project , which refuses to link with "terminal".

                ca6a2994-e8c5-4934-b5a7-21e0adafc493-image.png

                I am hoping that I can then use the working

                TERMINAL_SUBDIRS_PROJECT and its working "terminal".

                My main, so far faulty , project MaiN WINDOW IS "mdi.pro".
                I would prefer to use "mdi.pro"
                , but if it will work I could run the

                TERMINAL_SUBDIRS_PROJECT "MAIN_PROJECT"(,pro) main window" with
                A_Mar7_MAR17.pro as child.

                I do realize this approach is convoluted, but my main goal is is to link "TEST_MAIN_SUBPROJECT " with "terminal" irregardless how many parent - child levels it takes.

                THANKS

                A 1 Reply Last reply 8 Apr 2024, 14:18
                0
                • A Anonymous_Banned275
                  8 Apr 2024, 11:06

                  UPDATE

                  I have given up trying to physically find the "linker" problem.
                  I am trying a DIFFERENT way to resolve this AND could use some help.

                  I now have TWO "subdirs" projects - my main one , the one which refuses to work , and working "helper project".

                  The "helper project" works as expected - here is the result:

                  41b23c80-a94c-42ef-8716-3a4b2602ab9b-image.png

                  ![2c014c03-91ca-4ba5-ae24-cf8f36e7d9c3-image.png](https://ddgobkiprc33d.cloudfront.net/e8891de0-f237-4934-894d-ed0fc54abae2.png

                  As "subdirs" , the "helper project" has main .pro and terminal .pro.

                  I repeat - the "terminal" helper project works BY ITSELF as expected.

                  I have successfully added the "helper project " to my main project. - "TEST_MAIN_SUBPROJECT "

                  Here is the picture of ALL .pro files in it:

                  f34e3ce7-7b94-40a5-b026-07f4a6c6004a-image.png

                  HERE IS WHAT I NEED HELP WITH
                  Currently the TEST_MAIN_SUBPROJECT runs
                  TERMINAL_SUBDIRS_PROJECT "MAIN_PROJECT" - as posted at the start of this post.

                  I need to SWITCH it to run

                  A_Mar7_MAR17.pro

                  the original , faulty project , which refuses to link with "terminal".

                  ca6a2994-e8c5-4934-b5a7-21e0adafc493-image.png

                  I am hoping that I can then use the working

                  TERMINAL_SUBDIRS_PROJECT and its working "terminal".

                  My main, so far faulty , project MaiN WINDOW IS "mdi.pro".
                  I would prefer to use "mdi.pro"
                  , but if it will work I could run the

                  TERMINAL_SUBDIRS_PROJECT "MAIN_PROJECT"(,pro) main window" with
                  A_Mar7_MAR17.pro as child.

                  I do realize this approach is convoluted, but my main goal is is to link "TEST_MAIN_SUBPROJECT " with "terminal" irregardless how many parent - child levels it takes.

                  THANKS

                  A Offline
                  A Offline
                  Anonymous_Banned275
                  wrote on 8 Apr 2024, 14:18 last edited by
                  #13

                  @AnneRanch UPDATE

                  Question
                  what configures the Qt to run TEST_MAIN_SUBPROJECTpro ?

                  09:12:11: Running steps for project TEST_MAIN_SUBPROJECT...
                  09:12:11: Starting: "/home/nov25-1/Qt/5.15.2/gcc_64/bin/qmake" /mnt/A_BT_DEC10/BT__PROGRAMS/A_APR/A_APR6_MAR7_MAR19_CLEAN/A_BT_LIBRARY/CCC_SOURCE/TEST_MAIN_SUBPROJECT_PROJECT/TEST_MAIN_SUBPROJECT/TEST_MAIN_SUBPROJECT.pro -spec linux-clang CONFIG+=debug CONFIG+=qml_debug CONFIG+=force_debug_info CONFIG+=separate_debug_info
                  Project MESSAGE:
                  Project MESSAGE: run TEST_MAIN_SUBPROJECT.pro
                  Project MESSAGE:

                  it is LAST .pro in the project

                  10fddb64-c7e9-4c6c-9b4c-8f4ba1651412-image.png

                  J 1 Reply Last reply 8 Apr 2024, 14:25
                  0
                  • A Anonymous_Banned275
                    8 Apr 2024, 14:18

                    @AnneRanch UPDATE

                    Question
                    what configures the Qt to run TEST_MAIN_SUBPROJECTpro ?

                    09:12:11: Running steps for project TEST_MAIN_SUBPROJECT...
                    09:12:11: Starting: "/home/nov25-1/Qt/5.15.2/gcc_64/bin/qmake" /mnt/A_BT_DEC10/BT__PROGRAMS/A_APR/A_APR6_MAR7_MAR19_CLEAN/A_BT_LIBRARY/CCC_SOURCE/TEST_MAIN_SUBPROJECT_PROJECT/TEST_MAIN_SUBPROJECT/TEST_MAIN_SUBPROJECT.pro -spec linux-clang CONFIG+=debug CONFIG+=qml_debug CONFIG+=force_debug_info CONFIG+=separate_debug_info
                    Project MESSAGE:
                    Project MESSAGE: run TEST_MAIN_SUBPROJECT.pro
                    Project MESSAGE:

                    it is LAST .pro in the project

                    10fddb64-c7e9-4c6c-9b4c-8f4ba1651412-image.png

                    J Offline
                    J Offline
                    J.Hilk
                    Moderators
                    wrote on 8 Apr 2024, 14:25 last edited by
                    #14

                    @AnneRanch said in Undefined reference - again - discussion:

                    what configures the Qt to run TEST_MAIN_SUBPROJECTpro ?

                    when your project creates multiple executables that could potentially be executed. You can specify inside the project tab under "run settings" which executable is supposed to be run.

                    afcc0a39-dd12-499b-bab1-cdca662becae-image.png


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    A 1 Reply Last reply 8 Apr 2024, 15:41
                    1
                    • J J.Hilk
                      8 Apr 2024, 14:25

                      @AnneRanch said in Undefined reference - again - discussion:

                      what configures the Qt to run TEST_MAIN_SUBPROJECTpro ?

                      when your project creates multiple executables that could potentially be executed. You can specify inside the project tab under "run settings" which executable is supposed to be run.

                      afcc0a39-dd12-499b-bab1-cdca662becae-image.png

                      A Offline
                      A Offline
                      Anonymous_Banned275
                      wrote on 8 Apr 2024, 15:41 last edited by
                      #15

                      @J-Hilk f95763d0-7eba-4935-ad41-79232048202a-image.png

                      OK , I got this , BUT
                      it looks as there is no "pull down " box...

                      Not sure I want to do this manually.

                      J 1 Reply Last reply 8 Apr 2024, 15:46
                      0
                      • A Anonymous_Banned275
                        8 Apr 2024, 15:41

                        @J-Hilk f95763d0-7eba-4935-ad41-79232048202a-image.png

                        OK , I got this , BUT
                        it looks as there is no "pull down " box...

                        Not sure I want to do this manually.

                        J Offline
                        J Offline
                        JonB
                        wrote on 8 Apr 2024, 15:46 last edited by JonB 4 Aug 2024, 15:46
                        #16

                        @AnneRanch
                        You are looking at Build Settings. @J-Hilk showed Run Settings

                        You can specify inside the project tab under "run settings" which executable is supposed to be run.

                        1 Reply Last reply
                        1
                        • A Offline
                          A Offline
                          Anonymous_Banned275
                          wrote on 9 Apr 2024, 00:58 last edited by Anonymous_Banned275 4 Sept 2024, 00:59
                          #17

                          @JonB Unfortunately 'run setting" does not let select .pro but sudirs project executable.
                          That does not help to bypass the terminal problem.
                          If I select modify and select "mdi" it actually runs the "mdi" BEFORE the modification.
                          The editor shows errors , it should, and it should not run.

                          1 Reply Last reply
                          0
                          • J JonB referenced this topic on 10 Apr 2024, 16:41
                          • J JonB
                            5 Apr 2024, 17:21

                            @AnneRanch said in Undefined reference - again - discussion:

                            This code fails but there is no compiler error indicated

                            That is because it is a linker error. You told the compiler that there is a terminal_ORIGINAL_MainWindow class in another file, but you did not link with terminal_ORIGINAL_MainWindow.o , which you need to do as it has the class code, so the linker could not succeed.

                            If you had not #included the terminal_ORIGINAL_MainWindow.h file THAT would have given a compilation error on the new terminal_ORIGINAL_MainWindow() line. But including that allows it to compile, and says the terminal_ORIGINAL_MainWindow.o object file will be provided at link time. But, for whatever reason, it is not when you get your error.

                            That is what the Undefined reference error message from linker (ld) indicates each time.

                            A Offline
                            A Offline
                            Anonymous_Banned275
                            wrote on 10 Apr 2024, 17:55 last edited by
                            #18

                            @JonB OK, back to terminology...
                            I use "Add library" to add it to the subproject / object who needs it...
                            I let Qt to select "internal" library ....by project name - AKA "terminal"
                            From there it is Qt who actually adds stuff - mostly to .pro file.

                            I have to add required headers...
                            editor and compiler passes the headers as valid

                            Then I usually run "Clear" and "Rebuild".
                            That is it...

                            I do not see the references to library.o AND library.so until the complier / linker is done.

                            The linker error is actually very last few lies of the "Rebuild" process.

                            1 Reply Last reply
                            0

                            15/18

                            8 Apr 2024, 15:41

                            • Login

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