Unsolved Book example won't link/compile
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!
staggs9584 Banned last edited by staggs9584
This post is deleted!
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?
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.
@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).
@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?
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.
@MikeFinch just built it (for Windows) and it runs without modification.
@mzimmers Ah! but I use Linux. Any chance you can try it on linux?
eyllanesc 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 --versionon 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
@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.