Windows下安装qextserialport和qwt

1.安装qextserialport


i. 从http://code.google.com/p/qextserialport/下载最新的qextserialport.1.2win-alpha2.zip, 里面有编译好的lib和dll. 注意生成模式是Debug.

ii.调试例子:

"untitled2.pro"

QT += core gui


TARGET = untitled2
TEMPLATE = app




HEADERS += widget.h


INCLUDEPATH += C:/Users/Julio/Desktop/qextserialport/qextserialport/src
QMAKE_LIBDIR += C:/Users/Julio/Desktop/qextserialport/qextserialport/build/




CONFIG      += qt warn_on console


SOURCES += main.cpp\
        widget.cpp


#CONFIG(debug, debug|release):LIBS  += -lqextserialportd1
LIBS  += -lqextserialportd1


#unix:DEFINES   = _TTY_POSIX_
win32:DEFINES  = _TTY_WIN_



2.安装qwt

下载地址http://qwt.sourceforge.net/

因为没有现成库文件,所以要自己编译.

i. 先把qwtbuild里面的#QWT_CONFIG           += QwtDll屏蔽掉, 原因见QWidget: Must construct a QApplication before a QPaintDevice

2. 打开QtSDK Desktop Mingw,依次

C:\QtSDK\qwt-6.0.1>qmake qwt.pro

C:\QtSDK\qwt-6.0.1>C:\QtSDK\mingw\bin\mingw32-make.exe

C:\QtSDK\qwt-6.0.1>C:\QtSDK\mingw\bin\mingw32-make.exe install

3.和qextserial一起测试, Debug mode

QT       += core gui
 
  
TARGET = recieve
TEMPLATE = app
 
  
SOURCES += main.cpp\
    widget.cpp
 
  
HEADERS  +=  widget.h
 
  
 
  
INCLUDEPATH += C:/Users/Julio/Desktop/qextserialport/qextserialport/src/
QMAKE_LIBDIR += C:/Users/Julio/Desktop/qextserialport/qextserialport/build/
 
  
CONFIG      += qt warn_on console
 
  
LIBS  += -lqextserialportd1
 
  
 
  
INCLUDEPATH += C:/Qwt-6.0.1/include/
QMAKE_LIBDIR += C:/Qwt-6.0.1/lib/
 
  
CONFIG += qwt
 
  
LIBS  += -lqwt
 
  
win32:DEFINES  = _TTY_WIN_



你可能感兴趣的:(Windows下安装qextserialport和qwt)