Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Book example won't link/compile

    The Lounge
    4
    11
    437
    Loading More Posts
    • 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.
    • M
      MikeFinch last edited by

      Hello - I am studying Eng & Rischpater's 3rd edition "Application Development with Q.. C.." book.
      In Chapter 3 the QtGuiCalculator code runs OK but not QtQuickCalculator - error : main.o no such file or directory (therefore can't link).
      BTW the Github files for this book and chapter show main.cpp as well as main.qml. I presume main.cpp shouldn't be there? QtCreator complains about its presence also.
      As a possible clue, for Button.qml '===' seems to bother QC but '=' seems to avoid any error message.
      Can anyone help me with this? It's a very steep learning curve this C++ but I am trying to persevere!

      1 Reply Last reply Reply Quote 0
      • S
        staggs9584 Banned last edited by staggs9584

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • mzimmers
          mzimmers last edited by

          It would be easier to help with this if you posted actual code. There definitely should be a main.cpp file; the Qt Quick code gets started by C++ calls.

          What version of Qt are you using?

          1 Reply Last reply Reply Quote 1
          • M
            MikeFinch last edited by

            Thanks mzimmers : the main.cpp is correct afterall! I'm trying to attach a zip of the files (as downloaded from github plus my icon). I have both zip and tar.gz available - both 8.9kb in size.
            The problem now is - "How do I send an attachment?". Tried "Upload Image" but apparently I don't have privileges.

            M 1 Reply Last reply Reply Quote 0
            • M
              MikeFinch @MikeFinch last edited by

              @MikeFinch Further to mzimmers and anyone else interested : as stated before the code is on github. Please try it and see if you can get it to work. (No-one replied to my problem with doing a compressed upload).

              mzimmers 1 Reply Last reply Reply Quote 0
              • mzimmers
                mzimmers @MikeFinch last edited by

                @MikeFinch people don't generally attach much other than images in this forum. (You do that using the picture icon above the area where you enter your posting.) Generally, small amounts of code are just included in the code; for larger amounts, it's my understanding that people use gists.

                When you say the program is on on github, where in particular are you talking about?

                1 Reply Last reply Reply Quote 0
                • M
                  MikeFinch last edited by

                  mzimmers > the book, on page 3, gives "https://github.com/PacktPublishing/Application-Development-with-Qt-Creator-Third-Edition". If there is an "update to the code it will be published on the existing GitHub repository".
                  My version of QC is 4.15.1.
                  Let's see if QtQuickCalculator works for you! If it does then I will need to investigate further.

                  mzimmers 1 Reply Last reply Reply Quote 0
                  • mzimmers
                    mzimmers @MikeFinch last edited by

                    @MikeFinch just built it (for Windows) and it runs without modification.

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      MikeFinch @mzimmers last edited by

                      @mzimmers Ah! but I use Linux. Any chance you can try it on linux?

                      eyllanesc 1 Reply Last reply Reply Quote 0
                      • eyllanesc
                        eyllanesc @MikeFinch last edited by eyllanesc

                        @MikeFinch I do not see any problem when compiling the project with Qt 5.15.2 on Linux.

                        What version of Qt do you use? QtCreator version is different from Qt version, run qmake --version on the console. Also try compiling your project from the console:

                        git clone https://github.com/PacktPublishing/Application-Development-with-Qt-Creator-Third-Edition.git
                        cd Application-Development-with-Qt-Creator-Third-Edition/Chapter03/QtQuickCalculator
                        qmake .
                        make
                        ./QtQuickCalculator
                        

                        If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

                        1 Reply Last reply Reply Quote 0
                        • M
                          MikeFinch last edited by

                          @eyllanesc & mzimmers > prior to seeing your reply (eyll...) I did "a clean slate" try without any problem.
                          I seem to have become entangled somehow : in addition to the zipfiles in the main (non-build) folder I had QtQuickCalculator.pro.user, [QQC].qml and [QQC]Form.ui.qml - beats me what I did! Also had main.qml under Sources rather than Resources/. Groan.
                          Sorry to have unnecessarily bothered people with my own stupidity.
                          This deserves a [DELETE] rather than a [SOLVED] I think.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post