<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Qextserialport library issue]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I tried to include this<br />
<a href="http://code.google.com/p/qextserialport/wiki/QextSerialPort_1_2_Beta2" target="_blank" rel="noopener noreferrer nofollow ugc">http://code.google.com/p/qextserialport/wiki/QextSerialPort_1_2_Beta2</a></p>
<p dir="auto">but i dont know how to declare<br />
@    QextSerialPort *pport("COM");<br />
@<br />
in the headerfile.</p>
<p dir="auto">i have the headerfile:<br />
@#ifndef COMPORT_H<br />
#define COMPORT_H<br />
#include &lt;QMainWindow&gt;</p>
<p dir="auto">namespace Ui {<br />
class comport;<br />
}</p>
<p dir="auto">class comport : public QMainWindow<br />
{<br />
Q_OBJECT</p>
<p dir="auto">public:<br />
explicit comport(QWidget *parent = 0);<br />
~comport();<br />
QextSerialPort *pport("COM");</p>
<p dir="auto">public slots:<br />
void onDataAvailable();<br />
void MyClass();<br />
private:<br />
Ui::comport *ui;<br />
};</p>
<p dir="auto">#endif // COMPORT_H<br />
@</p>
<p dir="auto">and cpp file<br />
@</p>
<p dir="auto">#include "comport.h"<br />
#include "ui_comport.h"<br />
#include "qextserialport.h"</p>
<p dir="auto">comport::comport(QWidget *parent) :<br />
QMainWindow(parent),<br />
ui(new Ui::comport)<br />
{<br />
ui-&gt;setupUi(this);<br />
}</p>
<p dir="auto">comport::~comport()<br />
{<br />
delete ui;<br />
}</p>
<p dir="auto">...<br />
comport::MyClass()<br />
{<br />
//   port = new QextSerialPort("COM1");<br />
//   connect(port, SIGNAL(readyRead()), this, SLOT(onDataAvailable()));<br />
//  port-&gt;open();<br />
}</p>
<p dir="auto">void comport::onDataAvailable()<br />
{<br />
//  QByteArray data = port-&gt;readAll();<br />
// processNewData(usbdata);<br />
}<br />
@</p>
<p dir="auto">and included<br />
include(C:\qextserialport\qextserialport.pri)<br />
to the project file *.pro</p>
<p dir="auto">when i want to compile i get<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/c">@<bdi>C</bdi></a>:\Dokumente und Einstellungen\remy\Desktop\qextserialport-1.2beta2\com_port-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Debug..\com_port\comport.h:16: Fehler:ISO C++ forbids declaration of 'QextSerialPort' with no type<br />
@</p>
<p dir="auto">s.o. knows how to declare it right in the headerfile?</p>
<p dir="auto">thanks</p>
<p dir="auto">[edit: code tags corrected, koahnig]</p>
]]></description><link>https://forum.qt.io/topic/18511/qextserialport-library-issue</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 15:20:13 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/18511.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Jul 2012 10:30:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qextserialport library issue on Mon, 23 Jul 2012 12:12:22 GMT]]></title><description><![CDATA[<p dir="auto">You need to include QextSerialPort already in comport.h .</p>
]]></description><link>https://forum.qt.io/post/145311</link><guid isPermaLink="true">https://forum.qt.io/post/145311</guid><dc:creator><![CDATA[koahnig]]></dc:creator><pubDate>Mon, 23 Jul 2012 12:12:22 GMT</pubDate></item></channel></rss>