• 8899阅读
  • 6回复

编译qwt的例子时遇到的问题 [复制链接]

上一主题 下一主题
离线freshmanzkj
 
只看楼主 倒序阅读 楼主  发表于: 2009-10-03
qwt的例子本身运行没有问题,但是将例子的代码拷出来,重新运行,就有问题了。

下面是编译信息:

Running build steps for project 123456...
Creating gdb macros library...
Starting: D:/Qt/2009.01/qt/bin/qmake.exe E:/code_qt/3_different/123456/123456.pro -spec win32-g++ -r CONFIG+=debug_and_release
Exited with code 0.
Starting: D:/Qt/2009.01/mingw/bin/mingw32-make.exe debug -w
mingw32-make: Entering directory `E:/code_qt/3_different/123456'
D:/Qt/2009.01/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `E:/code_qt/3_different/123456'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\123456.exe debug/simple.o  -L"d:\Qt\2009.01\qt\lib" -lmingw32 -lqtmaind -L”D:/Qt/qwt/lib” -lqwt5 -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `E:/code_qt/3_different/123456'
mingw32-make: Leaving directory `E:/code_qt/3_different/123456'
D:\Qt\2009.01\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lqwt5
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\123456.exe] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project 123456
When executing build step 'Make'


大家帮我看看,缺的是什么?
谢谢!!
离线dbzhang800

只看该作者 1楼 发表于: 2009-10-03
离线freshmanzkj
只看该作者 2楼 发表于: 2009-10-03
引用第1楼dbzhang800于2009-10-03 07:58发表的  :
http://www.cuteqt.com/blog/?p=994


我就是按照这个上面的做得。

但是,按照他说的:编译时会出现很多头文件找不到的错误。

他的哪个方法,我没有解决。
离线dbzhang800

只看该作者 3楼 发表于: 2009-10-03
你只贴的上,
中、下两篇你看了没?

当面说的话,其实是个很简单的问题,但在论坛上,一两句还真不容易说清。如果建议你去看qmake的manual,你肯定又不会乐意。C/C++ 中使用第三方库,无非是一个头文件、一个是库文件;在Qt的pro文件中,一个是 INCLUDEPATH, 一个是LIBS
离线freshmanzkj
只看该作者 4楼 发表于: 2009-10-03
引用第3楼dbzhang800于2009-10-03 08:29发表的  :
你只贴的上,
中、下两篇你看了没?
当面说的话,其实是个很简单的问题,但在论坛上,一两句还真不容易说清。如果建议你去看qmake的manual,你肯定又不会乐意。C/C++ 中使用第三方库,无非是一个头文件、一个是库文件;在Qt的pro文件中,一个是 INCLUDEPATH, 一个是LIBS


中下都看过了。在Qt的pro文件中,一个是 INCLUDEPATH, 一个是LIBS,我把这两个路径加到工程文件里了。不知道为什么还不行。

mingw的ld找不到什么东西?


我正在看qmake的manual。
谢谢,呵呵!
离线freshmanzkj
只看该作者 5楼 发表于: 2009-10-03
我安装的过程:大家可以看看

######################################################################
# Install paths
######################################################################

VER_MAJ      = 5
VER_MIN      = 2
VER_PAT      = 0
VERSION      = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}

unix {
    INSTALLBASE    = /usr/local/qwt-5.2.0
}

win32 {
    INSTALLBASE    = C:/Qwt-5.2.0【修改】
}

target.path    = $$INSTALLBASE/lib
headers.path   = $$INSTALLBASE/include
doc.path       = $$INSTALLBASE/doc

######################################################################
# qmake internal options
######################################################################

CONFIG           += qt     # Also for Qtopia Core!
CONFIG           += warn_on
CONFIG           += thread

######################################################################
# release/debug mode
# If you want to build both DEBUG_SUFFIX and RELEASE_SUFFIX
# have to differ to avoid, that they overwrite each other.
######################################################################

VVERSION = $$[QT_VERSION]
isEmpty(VVERSION) {

    # Qt 3
    CONFIG           += release     # release/debug
}
else {
    # Qt 4
    win32 {
        # On Windows you can't mix release and debug libraries.
        # The designer is built in release mode. If you like to use it
        # you need a release version. For your own application development you
        # might need a debug version.
        # Enable debug_and_release + build_all if you want to build both.【按照他说的修改】

        CONFIG           += release     # release/debug/debug_and_release
        #CONFIG           += release_and_release
        #CONFIG           += build_all
    }
    else {
        CONFIG           += release     # release/debug
    }
}

######################################################################
# If you want to have different names for the debug and release
# versions you can add a suffix rule below.
######################################################################

DEBUG_SUFFIX        =
RELEASE_SUFFIX      =

win32 {
    DEBUG_SUFFIX      = d
}

######################################################################
# Build the static/shared libraries.
# If QwtDll is enabled, a shared library is built, otherwise
# it will be a static library.
######################################################################

CONFIG           += QwtDll

######################################################################
# QwtPlot enables all classes, that are needed to use the QwtPlot
# widget.
######################################################################

CONFIG       += QwtPlot

######################################################################
# QwtWidgets enables all classes, that are needed to use the all other
# widgets (sliders, dials, ...), beside QwtPlot.
######################################################################

CONFIG     += QwtWidgets

######################################################################
# If you want to display svg imageson the plot canvas, enable the
# line below. Note that Qwt needs the svg+xml, when enabling
# QwtSVGItem.
######################################################################

#CONFIG     += QwtSVGItem

######################################################################
# If you have a commercial license you can use the MathML renderer
# of the Qt solutions package to enable MathML support in Qwt.
# So if you want this, copy qtmmlwidget.h + qtmmlwidget.cpp to
# textengines/mathml and enable the line below.
######################################################################

#CONFIG     += QwtMathML

######################################################################
# If you want to build the Qwt designer plugin,
# enable the line below.
# Otherwise you have to build it from the designer directory.
######################################################################

CONFIG     += QwtDesigner

######################################################################
# If you want to auto build the examples, enable the line below
# Otherwise you have to build them from the examples directory.
######################################################################

#CONFIG     += QwtExamples【这个地方我去掉了】

然后就是再dos界面下:
1,qmake qwt.pro
2,make
3,make install

最后是修改环境变量。

做完了,在designer下有qwt的显示,例子导入可以运行。
离线freshmanzkj
只看该作者 6楼 发表于: 2009-10-08
我装好了,注意要把以前编译的错误文件删掉!
快速回复
限100 字节
 
上一个 下一个