Yes.Right. At some point I figured you might mean a make clean, but I was certain I had deleted the source directory and replaced it with an unaltered version of the original download. But now I checked the supposed unaltered version and there was in fact a 'lib' folder there, so I must have remembered that wrong.
So now, instead of a make clean of the source folder I just deleted the entire folder and made sure I replaced it with an actually unaltered original. This should be okay, I think... ?
Do you mean this warning?The make command worked well, except that continuously the same warning showed up. Something about a function "::isValid()" having already been defined. I wanted to copy the message, but it moved out of range. It was just a warning and only the same one over and over, though.
Qt Code:
warning: 'bool QwtInterval::isValid() const' redeclared without dllimport attribute after being referenced with dll linkageTo copy to clipboard, switch view to plain text mode
I got the same once, I looked for a reason but I didn't find anything. Whatever, my projects compiled.
Hmmm... that's worrying.The make install command then showed 1 error (identifying it as 'ignored' in brackets) about the system being unable to find a file. Again, it moved out of range so I couldn't copy it.
If you haven't a log yet that could help us to find a solution, the only thing that you could do is run some examples and include in your project a plot.
Ciao,
Marco
Computer Hater (10th October 2011)
Please forgive my ignorance on this, but just to avoid any misunderstanding:
Does that mean that starting over fresh with both target and source path, like I did, is not enough ? That I have to run a make distclean in the target path before deleting it when I reinstall ?
Also, is "build directory" the source path (as I'm initiating the build from there) or the target path (where it ends up being installed) ?
Yes, that's the one, and that's good to hear. Although it may help for Uwe to confirm that as well. ;-)
I do remember fairly certain (~90%) that it was a .dll with a 4-letter name.
I'll wait for a response to my first question to Uwe whether that make distclean issue requires another reinstall. Then, if it does, I will run it again and make a screenshot and increase the buffer size of the shell window some more. I thought I increased it enough last time, but it wasn't.
Thanks for the continued help to both of you. I hope we will get this resolved without too much trouble.
Hint: Think carefully before picking a user name.
qmake builds makefiles from the qmake project files. "make clean" removes everything, that has been build by make but not the makefiles itself. This is what "make distclean" does.
So when you copy a directory and don't rebuild the generated makefiles your build in the target directory will go wrong, because you have wrong paths in your makefiles.
That's all,
Uwe
So deleting *both* the source and the destination directories prior to a reinstall and then starting with a *fresh* copy of the downloaded Qwt ZIP file should be okay, right ?
Because that's what I did. I deleted both directories that could have been changed by the build process and used a copy of the unaltered original (except for renaming INSTALL etc. to .txt and commenting in the examples build in the .pri file).
Unless the build process creates/changes files in my Qt main installation that I did not delete/unchange, this should be fine.
You're possibly wondering now why I wasn't just doing the make clean(dist) and instead deleting everything altogether. Well, that's because being an amateur in this regard, that's the safest option for me, where I know I will most likely not overlook some detail that would have been obvious to an expert that messes up the whole thing.
So far I cannot confidenty gauge the precise purpose and scope of most of the things you and Marco are describing to me, so my only option is to keep it simple: Either follow very precise instructions, or apply basic operations whose scope I understand clearly, or some combination thereof.
That's why I'm so pertinacious on the delete-all thing.
It wasn't clear to me from your response whether you thought I had not deleted all those files (because you as an expert might not do it that way yourself) and were basing your instructions on that, or whether you knew I had and were trying to tell me it wasn't sufficient.
Hint: Think carefully before picking a user name.
Good question !
I was waiting to first get confirmation that I don't need another rebuild before going any further with the installation process. Which I suppose at this point would just be to get the Designer/Creator plugin to work.
But it can't hurt to try some coding, so here I go:
The auto completion recognizes Qwt and suggests both header files for #include and classes for coding. I included "qwt_plot_curve.h" in one of my project's class files and added a QwtPlotCurve pointer to the class members and it compiled. However, when I try to create the QwtPlotCurve object with
or withQt Code:
To copy to clipboard, switch view to plain text mode
Qt Code:
To copy to clipboard, switch view to plain text mode
I get the error
Qt Code:
C:\Qt\Projects\SiKat-build-desktop/../SiKat/plot_menu.cpp:164: error: undefined reference to `QwtPlotCurve::QwtPlotCurve(QString const&)'To copy to clipboard, switch view to plain text mode
Now I see that the header files are in the installation target's "lib" directory, but the CPP files are still only in the installation source's "src" directory.
So something probably still went wrong.
Hint: Think carefully before picking a user name.
It's right. Only headers are needed by the compiler.
Try to add a backslash at the end of your Qwt path into QMAKEFEATURES, like thisThe auto completion recognizes Qwt and suggests both header files for #include and classes for coding. I included "qwt_plot_curve.h" in one of my project's class files and added a QwtPlotCurve pointer to the class members and it compiled.
qmake -set QMAKEFEATURES C:\Qwt-6.0.1-svn\features\
and retry.
Post your code if this doesn't work
Ciao,
Marco
I tried this. Though previously I had QMAKEFEATURES set to the qwt.prf file inside that path, so I had to remove the specific file in order to add the backslash. Just saying.
I still get the same error.
So, I reconstructed the problem in a sample program which looks like this:
main.cpp
Qt Code:
#include <QtGui/QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { MainWindow w; w.show(); return app.exec(); }To copy to clipboard, switch view to plain text mode
mainwindow.h
Qt Code:
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "qwt_plot_curve.h" namespace Ui { class MainWindow; } { Q_OBJECT private: QwtPlotCurve* plotCurve; public: ~MainWindow(); private: Ui::MainWindow *ui; }; #endif // MAINWINDOW_HTo copy to clipboard, switch view to plain text mode
mainwindow.cpp
Qt Code:
#include "mainwindow.h" #include "ui_mainwindow.h" ui(new Ui::MainWindow) { ui->setupUi(this); //plotCurve = new QwtPlotCurve; } MainWindow::~MainWindow() { delete ui; }To copy to clipboard, switch view to plain text mode
I still get the same error when I try to allocate the object and no error when I don't. Although the error line now appears twice:
---C:/Qt/Projects/Test-build-desktop/debug/mainwindow.o:-1: In function `MainWindow':
C:\Qt\Projects\Test-build-desktop/../Test/mainwindow.cpp:10: error: undefined reference to `QwtPlotCurve::QwtPlotCurve(QString const&)'
C:\Qt\Projects\Test-build-desktop/../Test/mainwindow.cpp:10: error: undefined reference to `QwtPlotCurve::QwtPlotCurve(QString const&)'
:-1: error: collect2: ld returned 1 exit status
Oh, and my project file:
Qt Code:
#------------------------------------------------- # # Project created by QtCreator 2010-11-25T17:13:18 # #------------------------------------------------- QT += core gui TARGET = Test TEMPLATE = app CONFIG += qwt INCLUDEPATH += C:/Qwt-6.0.1/include/ SOURCES += main.cpp \ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui HEADERS += \ mainwindow.h FORMS += \ mainwindow.uiTo copy to clipboard, switch view to plain text mode
NOTE:
Actually, I had many of those lines commented out from a previous test on something else when I produced the above results. When I commented them in as above and added the Qwt references from my main project, I got these warnings on top, which I never had before:
C:/Qt/Projects/Test-build-desktop/Makefile.Debug:105: warning: overriding commands for target `debug/moc_mainwindow.cpp'
C:/Qt/Projects/Test-build-desktop/Makefile.Debug:102: warning: ignoring old commands for target `debug/moc_mainwindow.cpp'
C:/Qt/Projects/Test-build-desktop/Makefile.Debug:121: warning: overriding commands for target `ui_mainwindow.h'
C:/Qt/Projects/Test-build-desktop/Makefile.Debug:118: warning: ignoring old commands for target `ui_mainwindow.h'
Last edited by Computer Hater; 9th October 2011 at 17:23.
Hint: Think carefully before picking a user name.
I really don't know. Project file seems O.K., sources too.
Cleanup your Test project, deleting all the shadow build directories, run qmake on your project again: be sure that your Test Project's Makefiles are updated.
Ciao,
Marco
P.S.
You can remove line 'INCLUDEPATH += C:/Qwt-6.0.1/include/'.
I'm going to have to ask as it may be that I'm misunderstanding these terms...
1.) "Clean up" = run Clean All from Qt Creator's Build menu ?
2.) "Deleting all the shadow build directories" means this is done automatically by doing 1.) or do I have to do this manually ?
3.) What is a "shadow build" ? I've read this which explains what it is, and I'm not using several builds. But in my projects build settings in Creator, the "shadow build" mark is selected.
4.) "run qmake" = build from Creator which has qmake and make commands in it build steps ?
5.) "be sure that your Test Project's Makefiles are updated" ... Again does this mean this automatically done by cleaning and rebuilding or do I need to do something else ?
Also interesting to note is this, maybe it hints at the problem:
If I remove
'INCLUDEPATH += C:/Qwt-6.0.1/include/'
from my project file AND make a clean build, the line
is not recognized and I get the errorQt Code:
#include "qwt_plot_curve.h"To copy to clipboard, switch view to plain text mode
C:/Qt/Projects/Test-build-desktop/../Test/mainwindow.h:5: error: qwt_plot_curve.h: No such file or directory
Hint: Think carefully before picking a user name.
1) Yes but I don't know if Qt Creator clean also the Makefiles (distclean). So be sure that it does so, otherwise
2) delete manually everything that has been produced directly after qmake command (make distclean)
3) Shadow builds is a Qt Creator's feature (http://doc.qt.nokia.com/qtcreator-2....-settings.html). Qt Creator, by default, build in a separate directory from the source directory. This is called shadow build. This doesn't mean that you're doing something "strange" or unusual.
4) No. There's a specific menu entry "Run qmake" inside Build menu on Qt Creator that doesn't build the project, but only.. runs qmake command. Qt Creator should run qmake automatically after every .pro edit.
5) When you clean your test project's build directory from past builds, remove all the makefiles and run qmake again you are sure that your Makefiles are updated to your latest project file edit.
Yep! It's very interesting: it means that Qwt feature has not been loaded. This could be due to a wrong path inside QMAKEFEATURES variable.Also interesting to note is this, maybe it hints at the problem:
If I remove
'INCLUDEPATH += C:/Qwt-6.0.1/include/'
from my project file AND make a clean build, the line
is not recognized and I get the errorQt Code:
#include "qwt_plot_curve.h"To copy to clipboard, switch view to plain text mode
C:/Qt/Projects/Test-build-desktop/../Test/mainwindow.h:5: error: qwt_plot_curve.h: No such file or directory
This is the problem.
Computer Hater (10th October 2011)
Okay, here's what I did now:
I deleted the Test-build-desktop folder.
I changed "clean" to "distclean" in the clean steps of my project's build settings (see screenshot). I actually had done this before, just an hour ago, with no effect on its own, and changed it back again.
I ran "Clean (All)" from Qt Creator's build menu.
I ran "Run qmake" from Qt Creator's build menu.
I ran "Build (All)" from Qt Creator's build menu. (I only have the one project open.)
This time the project compiled !
I still get the same warnings as above. I also get the warnings about the 'isValid' routine being redeclared. But these go away when I compile again.
Actually, I got the exact same result even without deleting the folder and running qmake from the menu. Just for information.
When I run the program though, it crashes. It does not crash if I remove the line that allocates the QPlotCurve object, but if I run the debugger I see that it does not crash in this line directly but rather when trying to show the main window. And that is without having added the QPlotCurve anywhere !
It still looks a bit weird to me.
But please tell me that's progress !
Hint: Think carefully before picking a user name.
Update:
I did the same with my main project, as I realized I didn't get the persistent warnings there and could just try if it makes a difference. (Those warnings must be due to some of the changes I mentioned that I made to my Test project .pro file, I guess. Although I just mirrored the .pro structure that works in my main project. I checked. It's basically 1:1 the same, except less files.)
So, my main project now compiles with the inclusion of the QwtPlot header and instantion of a QwtPlot object.
I added it to one of my windows. It compiles, shows up where it's supposed to and doesn't crash the program.
The examples work as well.
So, SUCCESS !!
---
A couple more questions:
1.) Should I leave "distclean" in my projects' clean steps ?
2.) Given the complete source code and project file of my Test project I posted above, do you have an idea why I get these warnings and what they mean ?
As I said, I just mirrored the .pro structure from my main project.C:/Qt/Projects/Test-build-desktop/Makefile.Debug:105: warning: overriding commands for target `debug/moc_mainwindow.cpp'
C:/Qt/Projects/Test-build-desktop/Makefile.Debug:102: warning: ignoring old commands for target `debug/moc_mainwindow.cpp'
C:/Qt/Projects/Test-build-desktop/Makefile.Debug:121: warning: overriding commands for target `ui_mainwindow.h'
C:/Qt/Projects/Test-build-desktop/Makefile.Debug:118: warning: ignoring old commands for target `ui_mainwindow.h'
3.) Is there a reference on how Qwt classes inherit Qt classes such as QWidget and can thus be used directly in Qt's layouts ? I've found e.g. by looking through the source code that QwtPlot inherits QWidget, but QwtPlotCurve doesn't inherit from Qt.
The Qwt documentation shows only inheritance inside of Qwt (from what I've seen so far).
4.) Do you know of a good guide to this background knowledge that I'm lacking about system environment variables, make processes, etc. that's easy to understand for someone with no experience in that ?
Anyway,
thank you so so much for your help !!
Hint: Think carefully before picking a user name.
Welldone!
1) Yes. Leave only clean. Eventually you can run distclean manually.
2) No, sorry.
3) here: http://qwt.sourceforge.net/annotated.html, and here for QwtPlotCurve: http://qwt.sourceforge.net/class_qwt_plot_curve.html
4) About qmake (http://doc.qt.nokia.com/latest/qmake-manual.html). About Makefiles: http://mrbook.org/tutorials/make/
Ciao,
Marco
Computer Hater (10th October 2011)
Bookmarks