PDA

View Full Version : Building application with Qwt 6.1.0



frankiefrank
3rd August 2013, 16:48
I'm sorry to post what is probably the 1000th post about the subject but I did follow the instructions and I'm still stuck.

I've installed Qwt 6.1.0 (qmake, nmake, nmake install). I've also set permanently the QMAKEFEATURES to the features dir and it correctly shows the features folder path if I do "-query" on that variable.

However even with "CONFIG += qwt", the line
include "qwt_plot.h" gives me the error of "cannot open include file".

I've done it now in the command prompt of Qt 5.1. (qmake, nmake).

Could anyone please help me find the problem?

Uwe
5th August 2013, 09:18
Disable "CONFIG += silent" in your project file ( if set ) and have a look at the commands, when compiling your files. Do you see the path to the Qwt include directory there ?

Uwe

frankiefrank
5th August 2013, 12:23
Thanks for answering Uwe.

I don't have -silent set, but I'm not sure where I should be seeing the path.

My .pro file has



QT += core gui xml script declarative network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = MyAppCore
TEMPLATE = app

CONFIG += qwt

(I skipped the sources/headers/forms part)

I'm running qMake and building via Qt Creator (2.7.2).

When I go to the project properties I see:
"effective qMake call":
qmake.exe D:\MyAppCore\MyAppCore.pro -r -spec win32-msvc2010 "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug"

After that it runs a make step with jom.exe.

My output starts with:

Starting: "C:\Qt\Qt5.1.0\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5.1.0\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\include" -I"C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\include\QtDecl arative" -I"C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\include\QtWidg ets" -I"C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\include\QtNetw ork" -I"C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\include\QtScri pt" -I"C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\include\QtXml" -I"C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\include\QtGui" -I"C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\include\QtCore" -I"debug" -I"." -I"." -I"C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\mkspecs\win32-msvc2010" -Fodebug\ @C:\Users\myusername\AppData\Local\Temp\myproject. obj.5900.405.jom

I really don't see the Qwt folder here.

Uwe
5th August 2013, 12:40
I really don't see the Qwt folder here.
Yes, indicating that "CONFIG += qwt" didn't work because your qmake is not configured properly ( you can prove this easily by replacing "CONFIG += qwt" by "include ( C:\Qwt-6.1.0\features\qwt.prf )".

You wrote, that you have set QMAKEFEATURES - what exactly is the output of "qmake -query QMAKEFEATURES" and are you sure, that this is the same qmake version as it is used by the creator ?

Uwe

frankiefrank
5th August 2013, 13:02
That's helpful. I see that the Qt Versions tab lists the qmake from the "bin" folder. I went with cmd.exe to that path, and it still looks ok.

C:\Qt\Qt5.1.0\5.1.0\msvc2010_opengl\bin>qmake -query QMAKEFEATURES
C:\Qwt-6.1.0\features

Update: I'm doing this from the Visual Studio 2008 command line prompt. QMAKE with the above settings, the query seems ok but "nmake" doesn't contain any Qwt paths.

Uwe
6th August 2013, 08:40
What happens, when you replace "CONFIG += qwt" by the include statement above ?

Uwe

frankiefrank
6th August 2013, 10:13
I get this error:

moc_MyPlot.obj:-1: error: LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject" (?staticMetaObject@QwtPlot@@2UQMetaObject@@B)

Uwe
6th August 2013, 10:29
As "CONFIG += qwt" is only another way for including the installed qwt.prf you definitely have a problem with your QMAKEFEATURES setting. As everything you wrote in this thread looks o.k. to me something has to be wrong with what you have not written so far.
Concerning the link error: how does a compile and the link commands look like ?

Uwe

frankiefrank
6th August 2013, 11:44
Thanks for your reply and help so far!

I don't really know how else to check the QMAKEFEATURES. If I run the Qt 5.1 command prompt and try qmake -query qmakefeatures I get the correct path.

I now think I'm ok, but I did several things:

I took the advice from another post where you left a compliment on:
http://www.qtcentre.org/threads/53787-HowTo-Installation-of-Qt-5-0-1-and-Qwt-6-1-0-rc3-(Win7-64bit)

And added the Qwt-6.1.0\lib folder to my PATH variable. I also added the QMAKEFEATURES setting to the qmake "additional arguments" in Qt Creator. I then managed to build.

I'm not sure where the mess is coming from, hope I'm ok now.