Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. The Lounge
  4. Book example won't link/compile
Forum Updated to NodeBB v4.3 + New Features

Book example won't link/compile

Scheduled Pinned Locked Moved Unsolved The Lounge
11 Posts 4 Posters 1.0k 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.
  • M Offline
    M Offline
    MikeFinch
    wrote on last edited by
    #1

    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
    0
    • S Offline
      S Offline
      staggs9584
      Banned
      wrote on last edited by staggs9584
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #3

        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
        1
        • M Offline
          M Offline
          MikeFinch
          wrote on last edited by
          #4

          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
          0
          • M MikeFinch

            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 Offline
            M Offline
            MikeFinch
            wrote on last edited by
            #5

            @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).

            mzimmersM 1 Reply Last reply
            0
            • M MikeFinch

              @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).

              mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on last edited by
              #6

              @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
              0
              • M Offline
                M Offline
                MikeFinch
                wrote on last edited by
                #7

                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.

                mzimmersM 1 Reply Last reply
                0
                • M MikeFinch

                  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.

                  mzimmersM Offline
                  mzimmersM Offline
                  mzimmers
                  wrote on last edited by
                  #8

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

                  M 1 Reply Last reply
                  0
                  • mzimmersM mzimmers

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

                    M Offline
                    M Offline
                    MikeFinch
                    wrote on last edited by
                    #9

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

                    eyllanescE 1 Reply Last reply
                    0
                    • M MikeFinch

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

                      eyllanescE Offline
                      eyllanescE Offline
                      eyllanesc
                      wrote on last edited by eyllanesc
                      #10

                      @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
                      0
                      • M Offline
                        M Offline
                        MikeFinch
                        wrote on last edited by
                        #11

                        @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
                        0

                        • Login

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