CONFIG +=console
c:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0\libgcc_eh.a(unwind-dw2.o): In function `Unwind_Resume':C:\MinGW\src\gccbf\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind.inc:220: multiple definition of `_Unwind_Resume'./serialport/build\libqextserialportd.a(d000016.o):(.text+0x0): first defined herecollect2: ld returned 1 exit status
C:\MinGW\bin\mingw32-make.exe: Entering directory `D:/C++/qextserialport-1.2win-alpha/examples/enumerator-build-desktop' C:/MinGW/bin/mingw32-make.exe -f Makefile.Debug mingw32-make.exe[1]: Entering directory `D:/C++/qextserialport-1.2win-alpha/examples/enumerator-build-desktop' g++ -c -g -Wall -frtti -fexceptions -mthreads -D_TTY_WIN_ -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I'c:/Qt/4.6.3/include/QtCore' -I'c:/Qt/4.6.3/include/QtGui' -I'c:/Qt/4.6.3/include' -I'../../../qextserialport-1.2win-alpha' -I'c:/Qt/4.6.3/include/ActiveQt' -I'moc' -I'.' -I'c:/Qt/4.6.3/mkspecs/win32-g++' -o obj/main.o ../enumerator/main.cpp g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug/enumerator.exe obj/main.o -L'../../build' -L'c:/Qt/4.6.3/lib' -lqextserialportd -lQtGuid4 -lQtCored4 mingw32-make.exe[1]: Leaving directory `D:/C++/qextserialport-1.2win-alpha/examples/enumerator-build-desktop' C:\MinGW\bin\mingw32-make.exe: Leaving directory `D:/C++/qextserialport-1.2win-alpha/examples/enumerator-build-desktop' ../../build/libqextserialportd.a(qextserialenumerator.o): In function `ZN20QextSerialEnumerator17getDevicePropertyEPvP16_SP_DEVINFO_DATAm': D:/C++/qextserialport-1.2win-alpha/qextserialenumerator.cpp:53: undefined reference to `_imp__SetupDiGetDeviceRegistryPropertyW@28' D:/C++/qextserialport-1.2win-alpha/qextserialenumerator.cpp:55: undefined reference to `_imp__SetupDiGetDeviceRegistryPropertyW@28' ../../build/libqextserialportd.a(qextserialenumerator.o): In function `ZN20QextSerialEnumerator12setupAPIScanER5QListI12QextPortInfoE': D:/C++/qextserialport-1.2win-alpha/qextserialenumerator.cpp:68: undefined reference to `_imp__SetupDiGetClassDevsW@16' D:/C++/qextserialport-1.2win-alpha/qextserialenumerator.cpp:83: undefined reference to `_imp__SetupDiEnumDeviceInterfaces@20' D:/C++/qextserialport-1.2win-alpha/qextserialenumerator.cpp:87: undefined reference to `_imp__SetupDiGetDeviceInterfaceDetailW@24' D:/C++/qextserialport-1.2win-alpha/qextserialenumerator.cpp:96: undefined reference to `_imp__SetupDiGetDeviceInterfaceDetailW@24' D:/C++/qextserialport-1.2win-alpha/qextserialenumerator.cpp:106: undefined reference to `_imp__SetupDiOpenDevRegKey@24' collect2: ld returned 1 exit status mingw32-make.exe[1]: *** [debug/enumerator.exe] Error 1 C:\MinGW\bin\mingw32-make.exe: *** [debug] Error 2
00078 {00079 BAUD50, //POSIX ONLY00080 BAUD75, //POSIX ONLY00081 BAUD110,00082 BAUD134, //POSIX ONLY00083 BAUD150, //POSIX ONLY00084 BAUD200, //POSIX ONLY00085 BAUD300,00086 BAUD600,00087 BAUD1200,00088 BAUD1800, //POSIX ONLY00089 BAUD2400,00090 BAUD4800,00091 BAUD9600,00092 BAUD14400, //WINDOWS ONLY00093 BAUD19200,00094 BAUD38400,00095 BAUD56000, //WINDOWS ONLY00096 BAUD57600,00097 BAUD76800, //POSIX ONLY00098 BAUD115200,00099 BAUD128000, //WINDOWS ONLY00100 BAUD256000 //WINDOWS ONLY00101 };
default: Win_CommConfig.dcb.BaudRate=baudRate; break;
void SerialThread::open(QString newport, QString baud){ BaudRateType baudrate = (BaudRateType)baud.toULong(); port = new QextSerialPort(newport); port->setBaudRate(baudrate); port->setFlowControl(FLOW_OFF); port->setParity(PAR_NONE); port->setDataBits(DATA_8); port->setStopBits(STOP_2); port->setTimeout(500);}
void SerialThread::run(){ char buff[1024]; int numBytes = 0; if(port->isOpen()) { numBytes = port->bytesAvailable(); if(numBytes >0) { port->read(buff, numBytes); emit this->RX(buff); } else { this->msleep(100); } } else { this->msleep(100); }}