As I've said I'm providing here more one howto
How to build attach and use in your QT application [ Qt 4.6.3 ( latest ) ]
External serial port classes:
1. Download qextserialport-1.2win-alpha archive
2. Unpack the archive to <serport classes path>
3. Open .pro file that in the unpacked folder
4. Make it next:
PROJECT = qextserialport
TEMPLATE = lib
CONFIG += debug_and_release
CONFIG += qt
CONFIG += warn_on
CONFIG += thread
CONFIG += dll
CONFIG += staticlib
QT -= gui
OBJECTS_DIR = build/obj
MOC_DIR = build/moc
DEPENDDIR = .
INCLUDEDIR = .
HEADERS = qextserialbase.h \
qextserialport.h \
qextserialenumerator.h
SOURCES = qextserialbase.cpp \
qextserialport.cpp \
qextserialenumerator.cpp
unix: HEADERS += posix_qextserialport.h
unix: SOURCES += posix_qextserialport.cpp
unix: DEFINES += _TTY_POSIX_
win32:HEADERS += win_qextserialport.h
win32:SOURCES += win_qextserialport.cpp
win32: DEFINES += _TTY_WIN_
win32:LIBS += -lsetupapi
DESTDIR = build
DESTDIR = examples/enumerator/debug
DESTDIR = examples/qespta/debug
DESTDIR = examples/event/debug
CONFIG(debug, debug|release) {
TARGET = qextserialportd
} else {
TARGET = qextserialport
}
unix: VERSION = 1.2.0
5. build the serial port classes project assosiated with the .pro file in debug and in release mode
6. building process should produce next files: qextserialportd.dll, qextserialport.dll,libqextserialport.a in /build directory of the project
7. Each time you create new Qt project add next lines to the .pro file:
INCLUDEPATH += <serport classes path>qextserialport-1.2win-alpha
QMAKE_LIBDIR += <serport classes path>qextserialport-build-desktop\build
CONFIG(debug, debug|release):LIBS += -lqextserialportd
else:LIBS += -lqextserialport
unix: DEFINES = _TTY_POSIX_
win32: DEFINES = _TTY_WIN_
in appropriated positions in your application .pro file
8. Enjoy using RS232 with Qt
Pavel
pmazniker@gmail.com
Bookmarks