PDA

View Full Version : qextserialport help



miilun
12th June 2012, 08:06
I'm trying to compile qextserialport example called uartassistant. I have downloaded and unpacked qextserialport-1.2beta1.tar.gz. Then I have opened uartassistant example with Qt Creator and try to compile it, but I got this:

../../src/qextserialport_win.cpp: In member function 'bool QextSerialPortPrivate::open_sys(QFlags<*QIODevice::OpenModeFlag>)':
../../src/qextserialport_win.cpp:115: error: invalid use of incomplete type 'struct QWinEventNotifier'
../../src/qextserialport_p.h:159: error: forward declaration of 'struct QWinEventNotifier'
../../src/qextserialport_win.cpp:117: error: no matching function for call to 'QextSerialPort::connect(QWinEventNotifier*&, const char*, QextSerialPort* const&, const char*, Qt::ConnectionType)'
../../../QtSDK/Desktop/Qt/4.8.0/mingw/include/*QtCore/qobject.h:204: note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
../../../QtSDK/Desktop/Qt/4.8.0/mingw/include/*QtCore/qobject.h:217: note: static bool QObject::connect(const QObject*, const QMetaMethod&, const QObject*, const QMetaMethod&, Qt::ConnectionType)
../../../QtSDK/Desktop/Qt/4.8.0/mingw/include/*QtCore/qobject.h:337: note: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
../../src/qextserialport_win.cpp: In member function 'bool QextSerialPortPrivate::close_sys()':
../../src/qextserialport_win.cpp:132: error: invalid use of incomplete type 'struct QWinEventNotifier'
../../src/qextserialport_p.h:159: error: forward declaration of 'struct QWinEventNotifier'
../../src/qextserialport_win.cpp:133: error: invalid use of incomplete type 'struct QWinEventNotifier'
../../src/qextserialport_p.h:159: error: forward declaration of 'struct QWinEventNotifier'
mingw32-make.exe[1]: *** [debug/qextserialport_win.o] Error 1
mingw32-make.exe: *** [debug] Error 2
15:31:42: The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project uartassistant (target: Desktop)
When executing build step 'Make'

What is wrong? Should I have to do something before I try to compile example? My OS is Windows 7 64bit.

ChrisW67
12th June 2012, 23:43
The example is presumably relying on the QExtSerialPort header files being in the default include search path , and they are not. Use the INCLUDEPATH and LIBS variables in the PRO file to add the QExtSerialPort headers and libraries to the relevant paths.

hezbon
13th July 2012, 09:42
go the file that you extracted, copy the folder to the folder containing your project, then in the .pro of your project add this include(../thenameofyourqextserialfolder/src/qextserialport.pri)
you will notice that the whole folder now is opened in your project.
#include "mysecondthread.h" in your class header and you will have alright with you.
consider starting example of your own it is the best starting point.