Using QtSerialPort results in "APPCRASH"
Hi,
i'm trying to use the QtSerialPort Libary (http://qt-project.org/wiki/QtSerialPort). The install process worked fine (with Perl installed).
The problem is, as soon as i start my test program (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:
Code:
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
QT_USE_NAMESPACE
int main(int argc, char *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);
serial.close();
}
qDebug() << "End";
return a.exec();
}
.pro file:
Code:
#-------------------------------------------------
#
# 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)
Any ideas?
Re: Using QtSerialPort results in "APPCRASH"
Your exe is not able to find the correct dll for QSerialPort. It is able to link properly but absence of dll causes it to crash. Check the dll with right name (QSerialPort0.dll / QSerialPort.dll, check the wiki...) is available in the path of executable.
Re: Using QtSerialPort results in "APPCRASH"
I tried your suggestion and copied Qt5SerialPort.dll and Qt5SerialPortd.dll into the *.exe folder but it didn't work.
I still get the same error. :(
Added after 15 minutes:
I 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 the QByteArray. (datasize = 10 btw)
In my opinion the error seems to be somewhere in the QByteArray constructor, but i doubt that...
Any further ideas?
Re: Using QtSerialPort results in "APPCRASH"
Run your program in your debugger. When it crashes inspect the stack backtrace. Starting at the top work down until you find which line of your code is triggering the problem. Is it listing the ports, constructing the QSerialPort, or trying to open/close it?
Re: Using QtSerialPort results in "APPCRASH"
I 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 the QByteArray. (datasize = 10 btw)
In my opinion the error seems to be somewhere in the QByteArray constructor, but i doubt that...
Any further ideas?
Re: Using QtSerialPort results in "APPCRASH"
Is anyone able to reproduce this error?
I also tried the same on a Windows XP 32 bit machine, and got the same error.
Re: Using QtSerialPort results in "APPCRASH"
I also tried it with the newest release version of QtSerialPort. But i still get this error on both machines (Win7 64bit and WinXP 32bit)