PDA

View Full Version : Running the enumerator from QextSerialPort



Sherban
28th March 2011, 03:21
Hello I'm trying to get QT to communicate with my arduino board on a serial communications port. My application worked in eclipse but not on QT I did some research and it looks that QextSerialPort project would do the job. I tried running their example enumerator

#include <QtCore/QCoreApplication>
#include "qextserialenumerator.h"
#include "stdio.h"

using namespace std;

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);

QList<QextPortInfo> ports = QextSerialEnumerator::getPorts();
printf("List of ports:\n");
for (int i = 0; i < ports.size(); i++) {
printf("port name: %s\n", ports.at(i).portName.toLocal8Bit().constData());
printf("friendly name: %s\n", ports.at(i).friendName.toLocal8Bit().constData());
printf("physical name: %s\n", ports.at(i).physName.toLocal8Bit().constData());
printf("enumerator name: %s\n", ports.at(i).enumName.toLocal8Bit().constData());
printf("===================================\n\n");
}
return a.exec();
}

What I end up getting is "../enumerator.exe exited with code -1073741515". When I try to debug it I get an error "During startup program exited with code 0xc000..."

after some commenting, it turns out "QextSerialEnumerator::getPorts()" is to blame, because if I comment it out I can debug that program.

Does anyone have idea why would a call to a function cause such behaviour ?

Cruz
28th March 2011, 03:30
I don't know but the exit code doesn't look healthy. Why do you want to enumerate the ports? You can just configure a fixed port or cycle from 1 through 10 and try to open them.

Sherban
28th March 2011, 03:46
Hey Everyone

I figured out the problem. It was probably a dependency issue. In the .pro file for creating the qextserialport.dll there is some code:


DESTDIR = build
#DESTDIR = examples/enumerator/debug
#DESTDIR = examples/qespta/debug
#DESTDIR = examples/event/debug

I had to comment the 1st line and comment out the 2nd