PDA

View Full Version : Need help installing Qwt



Computer Hater
5th October 2011, 00:53
Hi.
I've just downloaded Qwt and am trying to install it. I'm not very good with this system environment stuff and a friend helped me install Qt, so I have a few questions despite reading the Qwt INSTALL file.
My system is Windows Vista Home Premium and I'm using Qt Creator with a MinGW toolchain.

From the Qwt INSTALL file:


Start a Shell, where Qt4 is initialized. ( F.e. with
"Programs->Qt by Trolltech ...->Qt 4.x.x Command Prompt" ).
Check if you can execute "make" or something like "mingw32-make".

qmake qwt.pro
make
make install

1.) It doesn't mention where to install Qwt. I just unzipped it and copied it into C:\qwt-6.0.1. Is that okay ? Or should I put it in my Qt Projects folder ?

2.) What does "a shell where Qt4 is initialized" mean ? I suppose it means that the make command is recognized. But when I open Windows Command Prompt, it isn't.
When I type "make ?", it says it's not recognized as an internal or external command.
The Program Menu folder "Qt SDK" only has the "MADDE Terminal" shell. But I haven't used this before, whether for installing Qt or otherwise.

3.) Can I maybe build it directly from the Qt Creator Projects menu instead of using the shell commands, seeing that there are qmake calls in the build steps ?
I tried just building the project from there. It seems to have compiled, but then when I tried to run it it said the process could not be started.

mpita
5th October 2011, 08:37
Hello,

if you have the latest Qt SDK or a "old" Qt framework version (the bundle that contains the Qt Libraries and the Qt Creator/Qt Designer) you should find in programs menu a shortcut called "Qt Command Prompt" that it's exactly what you said: a classic command prompt with some enviroment variables set so you can call qmake and mingw32-make command without specifiy the full path.

I advise you to move the qwt source directory out of C:\ because this is the default install target, and this may be confusing.

Open Qt Command Prompt (or just open your command prompt and set PATH='C:\the\path\of\your\qt\bin'), go inside the qwt source and simply launch "qmake", "mingw32-make" and "mingw32-make install" as written on INSTALL file.

I think that you can build the project directly with Qt Creator, but for installation, I think, you have to manually launch the make install command.

Hint: you can't "run" the project, since it's a library and not an application. But you can run the examples...

Marco

Spitfire
5th October 2011, 12:37
1. You can build Qwt anywhere you want, just you need later add a path to Qwt include files and libraries in your project.

2. "a shell where Qt4 is initialized" means a shell where qt environment variables are set. Qt command prompt (from start->all programs->qt sdk by nokia...) is such shell.

3. You can use QtCreator to buil Qwt.
The install step copies the binaries to their destination.

By default QtCreator uses shadow directory to build the project and then copies all *.a and *.dll files to <path to qwt source>/libs (defined by DESTDIR in src.pro)

To build and run Qwt examples from qwt.pro you need to uncomment line 108 in qwtconfig.pri (or add in qwt.pro QWT_CONFIG += QwtExamples).
Then all you need to do is to select active configuration to run (any example will do) and run it.

Computer Hater
5th October 2011, 15:54
Thank you both for your responses !

I checked again and I now did find a shell in the Qt SDK folder from the Programs menu. It was in the 'Desktop' subfolder and is called 'Qt 4.7.3 for Desktop (MinGW)'. I hope that's the right one.
It still doesn't find 'make' in that shell, but it does recognize 'qmake', so I figure that's okay.

I then proceeded to install and it worked mostly fine. But I might have another problem...

I left the Qwt source files in the 'C:\qwt-6.0.1' because I perhaps misread your remark that it may be 'confusing' to mean that Qwt would create a similarly named folder in C:\ that might confuse *me* later on.
But now it seems that Qwt tried to install into exactly that same folder. The installation worked mostly fine, but it did show a few errors and tried to copy a few files onto themselves, so I suppose it was a bad idea leaving the source folder there.
(I tried renaming it prior to installation, but I got file not found errors when I started the install process and so I just went with the original name.)

Should I uninstall it again and reinstall from a different location ?
If so, how do I undo this installation ?

mpita
5th October 2011, 16:15
I checked again and I now did find a shell in the Qt SDK folder from the Programs menu. It was in the 'Desktop' subfolder and is called 'Qt 4.7.3 for Desktop (MinGW)'. I hope that's the right one.
It still doesn't find 'make' in that shell, but it does recognize 'qmake', so I figure that's okay.

In your working enviroment (QT/MinGW) you haven't the 'make' command, instead you have the 'mingw32-make': so you have to follow these steps: qmake, mingw32-make and finally mingw32-make install;



I left the Qwt source files in the 'C:\qwt-6.0.1' because I perhaps misread your remark that it may be 'confusing' to mean that Qwt would create a similarly named folder in C:\ that might confuse *me* later on.
But now it seems that Qwt tried to install into exactly that same folder. The installation worked mostly fine, but it did show a few errors and tried to copy a few files onto themselves, so I suppose it was a bad idea leaving the source folder there.
(I tried renaming it prior to installation, but I got file not found errors when I started the install process and so I just went with the original name.)

As Spitfire said you can place your Qwt source folder where you want, but, in my opinion, it might confuse you later since C:\ is also the installation target.

Try to change the Qwt sources place (..maybe on desktop?), clean all the past installation tries (AFAIK just delete the C:\Qwt-... directory) and then try to rebuild/install using 'mingw32-make' command.

At the end of the install procedure, you should find inside the C:\Qwt.. directory the compiled libreries (.a and .dll), the headers, and the QT designer plugin.

Hope this may helps.


Ciao,
Marco

Computer Hater
5th October 2011, 18:17
Try to change the Qwt sources place (..maybe on desktop?), clean all the past installation tries (AFAIK just delete the C:\Qwt-... directory) and then try to rebuild/install using 'mingw32-make' command.

I did. And it worked ! I didn't see any error messages this time, just a few warnings.



At the end of the install procedure, you should find inside the C:\Qwt.. directory the compiled libreries (.a and .dll), the headers, and the QT designer plugin.

Hope this may helps.


Indeed, the files are there. It sure did help. Thank you so much !

-----
A few more questions:

1.)
The INSTALL file then says:



Don't forget to tell qmake where to find qwt.prf:
qmake -set QMAKEFEATURES ...

I took this to mean:
Type qmake -set QMAKEFEATURES qwt.prf
*after* the installation in *any* folder inside the shell.
I did that and the shell neither showed any error nor success message, so I guess it worked ?

2.) About using Qwt...
I checked the section about adding new features (http://doc.qt.nokia.com/4.7/qmake-advanced-usage.html#adding-new-configuration-features).

It says I have to add the feature file to the CONFIG environment variable. I currently don't have CONFIG in my environment variables (as listed in Qt Creator's Projects menu). I have CONFIGSETROOT. Is that the one or do I have to add CONFIG separately ?

mpita
5th October 2011, 20:57
Let's begin from the last question: 'CONFIG' is not an enviroment variable but is one of the most important qmake variable. If you take a look to your project (.pro) file, you'll find a reference to this variable.

Take a look here http://doc.qt.nokia.com/4.7/qmake-variable-reference.html

For example, with CONFIG, you can set if a library must build statically or dinamically or just tell if you want to see gcc warning messages.

Let's go on: when you launch the qmake -set QMAKEFEATURES path/qwt.prf, you tell to qmake that a new feature is available and all its information is stored inside the prf file specified. Adding Qwt as feature to your project allow you to enable Qwt just setting 'CONFIG += qwt' to your .pro, without care about paths; you can also add to your project Qwt specifying the qwt path into INCLUDEPATH, LIBS... it's the "dirty way"...!

If I scared you, maybe it's time to have a "quick" look to qmake world and all its features...!

http://doc.qt.nokia.com/4.7/qmake-running.html

Computer Hater
6th October 2011, 02:46
I see. I guess I could have seen that from the context in which CONFIG was used in the INSTALL file, but I missed it.

So, now I entered "qmake -set QMAKEFEATURES <path-to-qwt.prf>" on the command line.
I still got no feedback message, neither positive nor negative. :confused:

I then added "CONFIG += qwt" to my makefile (which btw didn't have any CONFIG statement before). The project compiled.

I could not instantly see if any Qwt functionality was available.
I tried typing "qwt" in my source code in Creator and auto completion suggested "QWT_DLL" and "QWT_MAKEDLL" which I suppose wouldn't have been available before.
Oddly enough, after re-opening my project this doesn't work anymore.
Also, when I tried e.g. typing 'include "qwt' or 'include <qwt' at the top of my header files it wouldn't suggest any of the Qwt classes for completion.

Another thing is that I tried to open one of the Qwt examples and realized they had not been installed in the C:\Qwt-6.0.1\ folder. I still have them in the source folder on my desktop. Can I just move them to a new more convenient location or do I have to do another reinstall from a permanent source location ? (I don't want to leave the folder on my desktop for permanent access.)

Sorry for being such a piece of work. :-/

mpita
6th October 2011, 08:35
First of all, I was talking about "project file" (myfantasticqtproject.pro): I supposed that you own a Qt project where you want to place some Qwt stuff; Makefiles are another kind of file that you should not care about.

Usually you open .pro files with Qt Creator, that runs for you 'qmake' command and produces the Makefiles for debug and release. It's the easiest way to develop with Qt.

If you installed qwt on its default target (C:\Qwt-6.0.1\), then you need to run 'qmake -set QMAKEFEATURES C:\Qwt-6.0.1\features' just one time and its doesn't show anything on output. Checking that qmake has successfully recognized the features path is possible with command 'qmake -query QMAKEFEATURES'.

Open your project file with a text editor or with the Qt Creator plain text editor, find the line "QT += .." and add the following line

CONFIG += qwt


Finally you're ready to go: try to add to your project a widget that shows a simple QwtPlotCurve.

Maybe you didn't compile the examples, try to check that inside 'C:\<path of your qwt sources\qwtconfig.pri' the line QWT_CONFIG += QwtExamples is uncommented. If so uncomment that line then rebuild qwt.

Ciao!
Marco

Computer Hater
6th October 2011, 15:26
First of all, I was talking about "project file" (myfantasticqtproject.pro): I supposed that you own a Qt project where you want to place some Qwt stuff; Makefiles are another kind of file that you should not care about.

Right. That was a stupid typo on my part. I meant I had edited my project file to include "CONFIG += qwt", not the makefile. And the project file didn't already have a CONFIG line, so I added the first CONFIG statement there.




If you installed qwt on its default target (C:\Qwt-6.0.1\), then you need to run 'qmake -set QMAKEFEATURES C:\Qwt-6.0.1\features' just one time and its doesn't show anything on output. Checking that qmake has successfully recognized the features path is possible with command 'qmake -query QMAKEFEATURES'.

Okay, I checked with the query command and it shows the features folder. So that part worked.




Maybe you didn't compile the examples, try to check that inside 'C:\<path of your qwt sources\qwtconfig.pri' the line QWT_CONFIG += QwtExamples is uncommented. If so uncomment that line then rebuild qwt.

That line is uncommented. However, inside my "C:\Qwt-6.0.1\" folder there are only the sub-folders "doc", "features", "include", "lib" and "plugins", none of which contains the source code or project files of the examples. Those are still in the source folder on my desktop. Hence my question if that source folder should have been placed somewhere more permanently and stick around as a source for the Qwt example projects. Up until now I had thought the examples would be copied into the installation target along with the rest.
Some of the other folders and files from the original source location are also missing.

What would I do ? Copy the examples manually to somewhere else or reinstall from another source location ?




Finally you're ready to go: try to add to your project a widget that shows a simple QwtPlotCurve.

The thing is that Qt Creator's source code editor doesn't seem to recognize anything starting with "Qwt" and the design area doesn't offer Qwt widgets.
I suppose I have to execute the last paragraph from the Qwt INSTALL file first:



For using the designer plugin you have to configure the Qt designer/creator
where to look for plugins. This can be done by setting the QT_PLUGIN_PATH or
using a qt.conf file ( see http://doc.qt.nokia.com/4.7/deployment-plugins.html ).
Beside the plugin the Qwt library itsself also needs to be known to the Designer/Creator
( see LD_LIBRARY_PATH, PATH ... above ).


The given link (http://doc.qt.nokia.com/4.7/deployment-plugins.html) says QT_PLUGIN_PATH is an environment variable. In my project's environment variables there wasn't a QT_PLUGIN_PATH variable, so I set it.
The Projects menu in Creator then specifically said:
Using System Environment and
Set QT_PLUGIN_PATH to C:\Qwt-6.0.1\plugins\designer\

I tried it with and without the \designer sub-folder, but it is still not recognized.

Now in the Qt Plugin section (http://doc.qt.nokia.com/4.7/deployment-plugins.html) it says that the Qt version number must not be lower than the plugin version number. My Qt version is 4.7.3. But where do I find the plugin version ?

Also, it says:


When building plugins to extend an application, it is important to ensure that the plugin is configured in the same way as the application. This means that if the application was built in release mode, plugins should be built in release mode, too.

I don't think I have "built" the plugin yet.
Maybe the problem is still with why the examples are not installed and the rest will fall in line ? :confused:

Uwe
6th October 2011, 16:11
I don't think I have "built" the plugin yet.
Maybe the problem is still with why the examples are not installed and the rest will fall in line ? :confused:
The examples are not installed because there is no reason to install them. That is intended - nothing wrong.

Uwe

mpita
6th October 2011, 16:15
If you want to use the qwt designer plugin the esiest way is to copy the 'qwt_designer_plugin.dll' file inside 'plugins\designer' of your qt framework. It's not the right way but, it works in 2 seconds (and worked for me). Then via 'About Plugins' inside the Designer's Help menu you should see if the plugin is successfully been loaded.

If examples are already compiled, their binaries lay on C:\<path of your qwt sources>\examples\bin.

If your creator doesn't find any qwt header, try to set in yout project file

INCLUDEPATH += <qwt installation path>/include/

Then run qmake again. Try to add #include <qwt_curve_plot.h>

Ciao!

Marco

Uwe
6th October 2011, 16:28
It's not the right way but, it works in 2 seconds (and worked for me).
2 seconds of wasted time, because he already configured the path ( what also works in 2 seconds ) + a source for having problems in the future.

Instead the missing step should be to configure the environment ( PATH, LD_LIBRARY_PATH ... ), so that the Creator can find the Qwt library, when it is loading the plugin.

Of course Qwt plugin/library need to be compatible with the Creator - that doesn't need be compatible to the Qt version you are trying to build your application with.
So when Creator and Qt installation are incompatibel you need to build and install Qwt twice.

Uwe

Computer Hater
6th October 2011, 18:23
The examples are not installed because there is no reason to install them. That is intended - nothing wrong.

Uwe

Okay.
So if they are not supposed to be copied into the installation directory as part of the installation, does that mean I can just manually copy them to a permanent location of my choice now that I installed Qwt or do I need to redo the installation directly from that location ?
They are still on the desktop currently from where I did the entire installation. And I don't think that would be a suitable permanent location.

I'd like to get this out of the way first in case this fact affects the other issues.

Added after 1 37 minutes:

Okay, I figured there would probably be no harm in deleting the Qwt destination folder and running the installation again from my chosen permanent source folder (where I want all the examples and other stuff that isn't copied to be stored permanently), even if it is maybe unnecessary.

So I just deleted my Qwt destination folder as Marco said above, copied my source folder from the desktop to a new folder C:\Qwt source 6.0.1\ and ran the installation again from there.

The mingw32-make command didn't find much to do. It just entered and left directories saying "Nothing to be done for 'all' "

The mingw32-make install command did the installation into the target folder again. Interestingly, although I ran it from a different location than before it still copied the files from the Qwt folder on my desktop.
Also it said that a few files couldn't be found by the system and showed errors.
And it entered and left a couple of directories saying "Nothing to be done for 'install' ".


I don't know if that was okay. But at least Qt Creator now finds the Qwt header files when I type 'include "qwt...'
So I'll continue from there for now.

Uwe
6th October 2011, 18:58
I don't know if that was okay.
No it was not !

Don't copy any files manually and always use different build and install directories - otherwise don't expect someone else to repair your installation.

Why do you insist on not following the instructions, when you are not familiar with this all ?

Uwe

Computer Hater
6th October 2011, 19:33
No it was not !

Don't copy any files manually and always use different build and install directories - otherwise don't expect someone else to repair your installation.

Why do you insist on not following the instructions, when you are not familiar with this all ?

Uwe

I don't insist on not following the instructions ! I tried to follow them, I had problems understanding them and so I asked questions.
This particular question about another possible reinstall had not been answered since I first asked it to Marco yesterday. Also I had done a reinstall before, as my above posts show. So the risk from another one at this point seemed minimal.
When I wrote "I don't know if this was okay.", I meant the command line output of the installation process. Not "I thought the reinstallation might mess things up, but I don't care and will do it anway".

Furthermore I did *not* copy files manually. I *asked* if I should do this and instead just reinstalled.

mpita
6th October 2011, 21:06
Okay.
So if they are not supposed to be copied into the installation directory as part of the installation, does that mean I can just manually copy them to a permanent location of my choice now that I installed Qwt or do I need to redo the installation directly from that location ?
They are still on the desktop currently from where I did the entire installation. And I don't think that would be a suitable permanent location.

I'd like to get this out of the way first in case this fact affects the other issues.


Extracting examples outside their native directory don't seem a good idea at all... they are strictly linked to qwt source path as you can see in examples.pri configuration file. If you don't think that keep qwt sources on desktop is comfortable then consider to make a "source" directory on Documents or C:\.



Okay, I figured there would probably be no harm in deleting the Qwt destination folder and running the installation again from my chosen permanent source folder (where I want all the examples and other stuff that isn't copied to be stored permanently), even if it is maybe unnecessary.

So I just deleted my Qwt destination folder as Marco said above, copied my source folder from the desktop to a new folder C:\Qwt source 6.0.1\ and ran the installation again from there.

The mingw32-make command didn't find much to do. It just entered and left directories saying "Nothing to be done for 'all' "


Nothing strange, if you didn't clean your past build, everything was already compiled since no changes were made on source files.



Interestingly, although I ran it from a different location than before it still copied the files from the Qwt folder on my desktop.


Hmmm, that's the reason why you had to clean the past build..



Also it said that a few files couldn't be found by the system and showed errors.
And it entered and left a couple of directories saying "Nothing to be done for 'install' ".
I don't know if that was okay


"Okay" and "Error" are two words that rarely sound good in the same sentence.. expecially in C++.
If you got some errors, maybe during the copy any files were already installed or were not found..



So I'll continue from there for now.

Nope, you can't. Clean up that mess before!!!

:D

Ciao,
Marco

Computer Hater
6th October 2011, 21:42
Extracting examples outside their native directory don't seem a good idea at all... they are strictly linked to qwt source path as you can see in examples.pri configuration file. If you don't think that keep qwt sources on desktop is comfortable then consider to make a "source" directory on Documents or C:\.


I didn't mean individually. I meant copying the whole folder structure of the downloaded qwt-6.0.1.zip file somewhere else. The question was before or after installation. That is, whether I had to install from the final path or whether it didn't matter.
I did that now (before the current installation) to the C:\Qwt source 6.0.1\ path.



Nothing strange, if you didn't clean your past build, everything was already compiled since no changes were made on source files.




Hmmm, that's the reason why you had to clean the past build..


But I deleted the destination path (as you said earlier in this thread) prior to the reinstall and then copied the unchanged original download (from a different location) and built from there. The only thing that should have been different is what was set in my Qt installation, right ?



"Okay" and "Error" are two words that rarely sound good in the same sentence.. expecially in C++.
If you got some errors, maybe during the copy any files were already installed or were not found..


I meant the error was that some files couldn't be found. Which of course can still be a bad thing. I just don't know how that could have happened.
I can post the specific error output here if I should have to do it again and if you can bear with me for some more.




Nope, you can't. Clean up that mess before!!!

:D


I would love to. I thought that was just what I did by deleting the entire destination folder and using the unaltered download file for the reinstall.

I could understand if you had enough of it. I guess I can ask my friend to help me out. (Which would also be through internet, so no 'live' advantage.)
Sorry for the confusion. I'm a noob with these system & setup things. I tried to not assume too much and instead ask more questions, but it seems to have not worked out too well. :-(

Maybe you can just tell me this:
Is the amount of cleaning that I have done and described enough, or do I have to reinstall Qt altogether ?

mpita
6th October 2011, 22:12
Is the amount of cleaning that I have done and described enough

No. When I was talking about "cleaning past build" I meant launch "mingw32-make clean". So if you have already build and installed qwt, before recompile, you should first delete the installation target (that's what you did), and then clean the source directory with "mingw32-make clean", that deletes all the compiled objects that still lay down within "lib" subdirectory in sources. Finally you're ready to recompile again (qmake, mingw32-make and mingw32-make install).

You don't find this into INSTALL file (usually, people don't need to spend their time building qwt more than once).

Anyway you're almost there, I don't think that you worked too bad. It's your first time.

If you didn't copy any dll or such anywhere, then reinstall Qt is useless since your framework is clean.

Ciao,

Marco

Computer Hater
6th October 2011, 23:33
No. When I was talking about "cleaning past build" I meant launch "mingw32-make clean". So if you have already build and installed qwt, before recompile, you should first delete the installation target (that's what you did), and then clean the source directory with "mingw32-make clean", that deletes all the compiled objects that still lay down within "lib" subdirectory in sources.

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... ?

Also, I noticed that amidst all the other issues I accidentally violated the no-space rule before and gave the source folder a name with spaces in my last attempt.
This time I chose a name with no spaces: C:\qwt-6.0.1-source\ and restarted the installation process. Again. :-D
I made sure I watched the entire process closely so I would spot any odd messages.

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.

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.

Other than that there were a couple of cases where the process entered and left a directory saying "Nothing to be done for 'Install' ".

Again - or still - the auto completion in Qt Creator suggests qwt libraries when I type '#include "qwt...'

It looks better than before, but I'm still uneasy about that error message and the 'Nothing to be done' messages. As you said it's never a good sign.

Uwe
7th October 2011, 08:01
No. When I was talking about "cleaning past build" I meant launch "mingw32-make clean".
It needs to be a "make distclean", before you copy the build directory. Otherwise the Makefiles with paths to the previous build directory are not rebuild. Instead of copying the build directory untar-ing the original Qwt tarball should be a better way.

Uwe

mpita
7th October 2011, 08:01
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... ?


Yes.




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.


Do you mean this warning?


warning: 'bool QwtInterval::isValid() const' redeclared without dllimport attribute after
being referenced with dll linkage

I got the same once, I looked for a reason but I didn't find anything. Whatever, my projects compiled.


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.

Hmmm... that's worrying.


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
7th October 2011, 14:59
It needs to be a "make distclean", before you copy the build directory. Otherwise the Makefiles with paths to the previous build directory are not rebuild. Instead of copying the build directory untar-ing the original Qwt tarball should be a better way.

Uwe

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) ?






warning: 'bool QwtInterval::isValid() const' redeclared without dllimport attribute after
being referenced with dll linkage

I got the same once, I looked for a reason but I didn't find anything. Whatever, my projects compiled.


Yes, that's the one, and that's good to hear. Although it may help for Uwe to confirm that as well. ;-)



Hmmm... that's worrying.
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.


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

Uwe
7th October 2011, 15:29
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 ?
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

Computer Hater
7th October 2011, 16:02
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.

mpita
7th October 2011, 21:19
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.


I see. But...

...does it work now?

Ciao,
Marco

Computer Hater
7th October 2011, 23:05
I see. But...

...does it work now?

Ciao,
Marco

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


plotCurve = new QwtPlotCurve("Qwt Curve");

or with


plotCurve = new QwtPlotCurve;


I get the error


C:\Qt\Projects\SiKat-build-desktop/../SiKat/plot_menu.cpp:164: error: undefined reference to `QwtPlotCurve::QwtPlotCurve(QString const&)'


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.

mpita
9th October 2011, 09:51
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.

It's right. Only headers are needed by the compiler.



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.


Try to add a backslash at the end of your Qwt path into QMAKEFEATURES, like this

qmake -set QMAKEFEATURES C:\Qwt-6.0.1-svn\features\

and retry.

Post your code if this doesn't work


Ciao,
Marco

Computer Hater
9th October 2011, 16:43
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 this
qmake -set QMAKEFEATURES C:\Qwt-6.0.1-svn\features\
and retry.

Post your code if this doesn't work


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

#include <QtGui/QApplication>
#include "mainwindow.h"

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow w;
w.show();

return app.exec();
}



mainwindow.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "qwt_plot_curve.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
Q_OBJECT
private:
QwtPlotCurve* plotCurve;

public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

private:
Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H


mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);

//plotCurve = new QwtPlotCurve;
}

MainWindow::~MainWindow()
{
delete ui;
}


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:



#-------------------------------------------------
#
# 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.ui


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'

mpita
9th October 2011, 19:20
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/'.

Computer Hater
9th October 2011, 19:51
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.


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 (http://doc.qt.nokia.com/4.7-snapshot/shadow-builds-wince.html) 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

#include "qwt_plot_curve.h"
is not recognized and I get the error

C:/Qt/Projects/Test-build-desktop/../Test/mainwindow.h:5: error: qwt_plot_curve.h: No such file or directory

mpita
9th October 2011, 20:06
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 (http://doc.qt.nokia.com/4.7-snapshot/shadow-builds-wince.html) 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 ?


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.3/creator-build-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.



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

#include "qwt_plot_curve.h"
is not recognized and I get the error

C:/Qt/Projects/Test-build-desktop/../Test/mainwindow.h:5: error: qwt_plot_curve.h: No such file or directory

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.

This is the problem.

Computer Hater
9th October 2011, 20:53
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 ! :)

Computer Hater
10th October 2011, 02:38
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 ?

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'
As I said, I just mirrored the .pro structure from my main project.
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 !! :)

mpita
10th October 2011, 08:39
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.
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 !! :)

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, 18:57
1) Yes. Leave only clean. Eventually you can run distclean manually.


I assume you meant "No. Leave only clean..."

Thanks again !
I think I can manage from here. :)