<?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[Inheritance classes draw errors: cannot allocate objects of abstract type]]></title><description><![CDATA[<p dir="auto">I am attempting to create a wrapper for the many Jack Audio library functions that will be binary compatible.  The structure is using the base / abstract class model with d_ptr references.</p>
<p dir="auto">The base class : jackport.h<br />
[code]<br />
class JackPortPrivate;<br />
class JackPort<br />
{</p>
<p dir="auto">public:<br />
JackPort(const QString &amp;name, JackPortFlags type);<br />
virtual ~JackPort();</p>
<p dir="auto">protected:<br />
virtual void setData(void *data, quint32 nFrames) = 0;<br />
// this function is called by the jack thread<br />
// Implement it to implement your own port<br />
//  param: data the buffer that jack provide. It is valid until the function returns<br />
//  param: nFrames the number of frames in data<br />
//<br />
JackPortPrivate *const d_ptr;<br />
JackPort(JackPortPrivate &amp;dd);</p>
<p dir="auto">private:<br />
friend class QJackClient;<br />
friend class QJackClientPrivate;<br />
Q_DECLARE_PRIVATE(JackPort)<br />
};<br />
[/code]</p>
<p dir="auto">The derived class is:<br />
[code]<br />
#include "jackport.h"</p>
<p dir="auto">namespace QJack<br />
{<br />
class JackInPort : public JackPort<br />
{<br />
// Inherit from this class if you want to create your own inport</p>
<p dir="auto">public:<br />
JackInPort(QString &amp;name);<br />
};<br />
} // namespace<br />
[/code]</p>
<p dir="auto">used as : in_port = new QJack::JackInPort("inport", client-&gt;nFrames() * 2, client); (supplied code is not complete)</p>
<p dir="auto">Some of the background for this is in the  KDE-technical article on Binary Compatibility Future Strategies found here: <a href="http://techbase.kde.org/Policies/Library_Code_Policy" target="_blank" rel="noopener noreferrer nofollow ugc">http://techbase.kde.org/Policies/Library_Code_Policy</a> and here: <a href="http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++" target="_blank" rel="noopener noreferrer nofollow ugc">http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++</a>.</p>
<p dir="auto">What am I missing?</p>
]]></description><link>https://forum.qt.io/topic/22296/inheritance-classes-draw-errors-cannot-allocate-objects-of-abstract-type</link><generator>RSS for Node</generator><lastBuildDate>Sun, 10 May 2026 02:07:23 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/22296.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 17 Dec 2012 17:28:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Inheritance classes draw errors: cannot allocate objects of abstract type on Mon, 17 Dec 2012 20:36:25 GMT]]></title><description><![CDATA[<p dir="auto">Thank you Lukas ... I have been able to proceed with it now.</p>
]]></description><link>https://forum.qt.io/post/159889</link><guid isPermaLink="true">https://forum.qt.io/post/159889</guid><dc:creator><![CDATA[ad5xj]]></dc:creator><pubDate>Mon, 17 Dec 2012 20:36:25 GMT</pubDate></item><item><title><![CDATA[Reply to Inheritance classes draw errors: cannot allocate objects of abstract type on Mon, 17 Dec 2012 19:01:00 GMT]]></title><description><![CDATA[<p dir="auto">&lt;code&gt;JackInPort&lt;/code&gt; does not implement &lt;code&gt;void setData(void *data, quint32 nFrames)&lt;/code&gt; and therefore is an abstract type due to the base &lt;code&gt;JackPort&lt;/code&gt; beeing an abstract type as well.</p>
]]></description><link>https://forum.qt.io/post/159886</link><guid isPermaLink="true">https://forum.qt.io/post/159886</guid><dc:creator><![CDATA[lgeyer]]></dc:creator><pubDate>Mon, 17 Dec 2012 19:01:00 GMT</pubDate></item></channel></rss>