Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

[QtSerialPort] Simple example crashes

$
0
0
Hi, i’m trying to use the QtSerialPort Libary (http://qt-project.org/wiki/QtSerialPort). The install process worked fine (with Perl installed) and the library files were copied into my Qt installation. (C:\Tools\Qt\Qt5.0.2\5.0.2\mingw47_32 and some other folders). The problem is, as soon as i start the simple example of the project wiki (debug or release mode) it crashes with this error: Problemsignatur: Problemereignisname: APPCRASH Anwendungsname: Test.exe Anwendungsversion: 0.0.0.0 Anwendungszeitstempel: 51a3623c Fehlermodulname: Qt5Cored.dll Fehlermodulversion: 5.0.2.0 Fehlermodulzeitstempel: 516367ae Ausnahmecode: c0000005 Ausnahmeoffset: 00021f3b Betriebsystemversion: 6.1.7601.2.1.0.256.48 Gebietsschema-ID: 1031 Zusatzinformation 1: 0a9e Zusatzinformation 2: 0a9e372d3b4ad19135b953a78882e789 Zusatzinformation 3: 0a9e Zusatzinformation 4: 0a9e372d3b4ad19135b953a78882e789 .cpp file:     #include <QtCore/QCoreApplication>     #include <QtCore/QDebug>           #include <QtSerialPort/QSerialPort>     #include <QtSerialPort/QSerialPortInfo>           QT_USE_NAMESPACE           int main(int argc, char *argv[])     {     QCoreApplication a(argc, argv);           qDebug() << "Begin";           // Example use QSerialPortInfo     foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {     qDebug() << "Name : " << info.portName();     qDebug() << "Description : " << info.description();     qDebug() << "Manufacturer: " << info.manufacturer();           // Example use QSerialPort     QSerialPort serial;     serial.setPort(info);     if (serial.open(QIODevice::ReadWrite))     serial.close();     }           qDebug() << "End";     return a.exec();     } .pro file:     #-------------------------------------------------     #     # Project created by QtCreator 2013-05-10T15:50:24     #     #-------------------------------------------------           QT += core           QT -= gui           QT += serialport           TARGET = Test     CONFIG += console     CONFIG -= app_bundle           TEMPLATE = app                 SOURCES += main.cpp My setup is: Windows 7 Prof. 64 bit Qt 5.0.2 32 bit QtSerialPort Stable (f301591) I already tracked the error with debug mode and there i get a “SIGSEGV” “Segmentation fault” error within the file: “qserialportinfo_win.cpp” in line 132 (QByteArray data(datasize, 0)) while creating a QByteArray for the COM device name (datasize = 10 btw). But i think this can’t be the error source, creating a QByteArray within my main.c works perfectly. Any further ideas how i can fix this?

Viewing all articles
Browse latest Browse all 13965

Trending Articles