<?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[How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/76672/can-t-pass-a-signal-with-qsharedpointer-or-std-shared_ptr-between-threads">Can't pass a signal with QSharedPointer (or std::shared_ptr&lt;&gt;) between threads</a></p>
<p dir="auto">hi<br />
the program is this:<br />
#include &lt;QCoreApplication&gt;<br />
#include &lt;iostream&gt;<br />
#include &lt;memory&gt;<br />
#include &lt;QObject&gt;<br />
#include &lt;QMetaType&gt;</p>
<p dir="auto">class Student : public QObject<br />
{<br />
Q_OBJECT</p>
<p dir="auto">public:<br />
void printOrder()<br />
{<br />
emit calledtoPrint();<br />
}</p>
<p dir="auto">signals:<br />
void calledtoPrint();<br />
};<br />
Q_DECLARE_METATYPE(Student)</p>
<p dir="auto">class Printer : public QObject<br />
{<br />
Q_OBJECT<br />
//uncrustify off<br />
public slots:<br />
//uncrustify on<br />
void print()<br />
{<br />
std::cout &lt;&lt; " print the request" &lt;&lt; std::endl;<br />
}<br />
};<br />
Q_DECLARE_METATYPE(Printer)<br />
int main(int argc, char* argv[])<br />
{<br />
QCoreApplication a(argc, argv);</p>
<pre><code>std::shared_ptr&lt;Student&gt; std = std::make_shared&lt;Student&gt;();
std::shared_ptr&lt;Printer&gt; print = std::make_shared&lt;Printer&gt;();
QObject::connect(std.get(), &amp;Student::printOrder, print.get(), &amp;Printer::print);

std::cout &lt;&lt; "Program start " &lt;&lt; std::endl;

std-&gt;printOrder();

return a.exec();
</code></pre>
<p dir="auto">}</p>
]]></description><link>https://forum.qt.io/topic/146028/how-can-i-solve-this-bug-in-share-ptr-signal-slot-1-error-cmakefiles-signalslotshareptr_autogen-dir-build-make-58-cmakefiles-signalslotshareptr_autogen-error-1</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 04:05:44 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/146028.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Jun 2023 05:34:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 08:18:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nasimchildofdesert">@<bdi>nasimChildOfDesert</bdi></a> said in <a href="/post/762712">How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles/signalSlotsharePtr_autogen.dir/build.make:58: CMakeFiles/signalSlotsharePtr_autogen] Error 1</a>:</p>
<blockquote>
<p dir="auto">contains a "Q_OBJECT" macro, but does not include "main.moc"!</p>
</blockquote>
<p dir="auto">This is the error and it also tells you what you should do to fix it:</p>
<pre><code>Consider to

    add #include "main.moc"
    enable SKIP_AUTOMOC for this file
</code></pre>
<p dir="auto">It is better to define QObject based classes in their own header and cpp files.</p>
]]></description><link>https://forum.qt.io/post/762713</link><guid isPermaLink="true">https://forum.qt.io/post/762713</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 27 Jun 2023 08:18:12 GMT</pubDate></item><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 08:10:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a><br />
im sorry : the compile out put is:<br />
11:39:22: Running steps for project signalSlotsharePtr...<br />
11:39:23: Starting: "/usr/bin/cmake" --build . --target clean<br />
11:39:23: The process "/usr/bin/cmake" exited normally.<br />
11:39:23: Starting: "/usr/bin/cmake" --build . --target all<br />
[ 25%] Automatic MOC and UIC for target signalSlotsharePtr</p>
<h2>AutoMoc error</h2>
<p dir="auto">"SRC:/main.cpp"<br />
contains a "Q_OBJECT" macro, but does not include "main.moc"!<br />
Consider to</p>
<ul>
<li>add #include "main.moc"</li>
<li>enable SKIP_AUTOMOC for this file</li>
</ul>
<p dir="auto">make[2]: *** [CMakeFiles/signalSlotsharePtr_autogen.dir/build.make:58: CMakeFiles/signalSlotsharePtr_autogen] Error 1<br />
make[1]: *** [CMakeFiles/Makefile2:104: CMakeFiles/signalSlotsharePtr_autogen.dir/all] Error 2<br />
make: *** [Makefile:84: all] Error 2<br />
11:39:23: The process "/usr/bin/cmake" exited with code 2.<br />
Error while building/deploying project signalSlotsharePtr (kit: Desktop Qt 5.13.1 GCC 64bit)<br />
When executing step "CMake Build"<br />
11:39:23: Elapsed time: ۰:۰۰:۰۰.</p>
]]></description><link>https://forum.qt.io/post/762712</link><guid isPermaLink="true">https://forum.qt.io/post/762712</guid><dc:creator><![CDATA[nasimChildOfDesert]]></dc:creator><pubDate>Tue, 27 Jun 2023 08:10:03 GMT</pubDate></item><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 07:58:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nasimchildofdesert">@<bdi>nasimChildOfDesert</bdi></a> said in <a href="/post/762703">How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles/signalSlotsharePtr_autogen.dir/build.make:58: CMakeFiles/signalSlotsharePtr_autogen] Error 1</a>:</p>
<blockquote>
<p dir="auto">i send all of the code.did you see that?</p>
</blockquote>
<p dir="auto">I'm not asking for code, but for the error message...</p>
]]></description><link>https://forum.qt.io/post/762706</link><guid isPermaLink="true">https://forum.qt.io/post/762706</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 27 Jun 2023 07:58:04 GMT</pubDate></item><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 07:56:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nasimchildofdesert">@<bdi>nasimChildOfDesert</bdi></a> I will repeat this one more time: <strong>the actual error is above the line you posted!</strong> Can you please post the error? You can also post the whole build log.</p>
<p dir="auto">This is not the error: :-1: error: [CMakeFiles/signalSlotsharePtr_autogen.dir/build.make:58: CMakeFiles/signalSlotsharePtr_autogen] Error 1<br />
It just tells you that there was an error. The error message must be <strong>ABOVE</strong> that line...</p>
]]></description><link>https://forum.qt.io/post/762705</link><guid isPermaLink="true">https://forum.qt.io/post/762705</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 27 Jun 2023 07:56:44 GMT</pubDate></item><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 07:51:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a><br />
you know , when i build my program it show this error .<br />
i send all of the code.did you see that?</p>
]]></description><link>https://forum.qt.io/post/762703</link><guid isPermaLink="true">https://forum.qt.io/post/762703</guid><dc:creator><![CDATA[nasimChildOfDesert]]></dc:creator><pubDate>Tue, 27 Jun 2023 07:51:40 GMT</pubDate></item><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 07:08:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nasimchildofdesert">@<bdi>nasimChildOfDesert</bdi></a> Why don't you simply post the error message?!</p>
]]></description><link>https://forum.qt.io/post/762691</link><guid isPermaLink="true">https://forum.qt.io/post/762691</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 27 Jun 2023 07:08:18 GMT</pubDate></item><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 07:06:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nasimchildofdesert">@<bdi>nasimChildOfDesert</bdi></a><br />
iknow it is not specific error but i have this problem and share it . maybe someone help me.i cant build ,y cmake program in qt</p>
]]></description><link>https://forum.qt.io/post/762690</link><guid isPermaLink="true">https://forum.qt.io/post/762690</guid><dc:creator><![CDATA[nasimChildOfDesert]]></dc:creator><pubDate>Tue, 27 Jun 2023 07:06:20 GMT</pubDate></item><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 06:45:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nasimchildofdesert">@<bdi>nasimChildOfDesert</bdi></a> This is not the actual error!<br />
The actual error should be somewhere wbove that line. Please post it...</p>
]]></description><link>https://forum.qt.io/post/762688</link><guid isPermaLink="true">https://forum.qt.io/post/762688</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 27 Jun 2023 06:45:00 GMT</pubDate></item><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 06:42:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nasimchildofdesert">@<bdi>nasimChildOfDesert</bdi></a></p>
<p dir="auto">it doesnt build and show this:<br />
:-1: error: [CMakeFiles/signalSlotsharePtr_autogen.dir/build.make:58: CMakeFiles/signalSlotsharePtr_autogen] Error 1</p>
]]></description><link>https://forum.qt.io/post/762687</link><guid isPermaLink="true">https://forum.qt.io/post/762687</guid><dc:creator><![CDATA[nasimChildOfDesert]]></dc:creator><pubDate>Tue, 27 Jun 2023 06:42:01 GMT</pubDate></item><item><title><![CDATA[Reply to How can I solve this bug in share-ptr signal slot ::-1: error: [CMakeFiles&#x2F;signalSlotsharePtr_autogen.dir&#x2F;build.make:58: CMakeFiles&#x2F;signalSlotsharePtr_autogen] Error 1 on Tue, 27 Jun 2023 06:07:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nasimchildofdesert">@<bdi>nasimChildOfDesert</bdi></a> Please post the actual error.</p>
]]></description><link>https://forum.qt.io/post/762684</link><guid isPermaLink="true">https://forum.qt.io/post/762684</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 27 Jun 2023 06:07:52 GMT</pubDate></item></channel></rss>