<?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[linker command failed with exit code 1 - Mac]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">I am new to Qt and I have a little problem.</p>
<p dir="auto">I am trying to create a tic tac toe following a tutorial I found on internet but at some point I get this message :<br />
&lt;pre&gt;&lt;code&gt;ld: symbol(s) not found for architecture x86_64<br />
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br />
&lt;/code&gt;&lt;/pre&gt;</p>
<p dir="auto">I  have created an interface with the design editor that worked well but when I try to link buttons through the .cpp life it fails.</p>
<p dir="auto">Can you help me please?<br />
It is for a school project and I am quitte in a hustle right now.</p>
<p dir="auto">I run on OSX El Capitan with Qt Creator 3.5.0<br />
Here is my code (classes are in French since I ma french héhé) :</p>
<p dir="auto"><strong>CLASS FILE</strong></p>
<p dir="auto">&lt;code&gt;</p>
<p dir="auto">#include "notreclasse.h"<br />
#include "ui_notreclasse.h"</p>
<p dir="auto">notreClasse::notreClasse(QWidget *parent) :<br />
QDialog(parent),<br />
ui(new Ui::notreClasse)<br />
{<br />
ui-&gt;setupUi(this);</p>
<pre><code>connect(ui-&gt;b1, SIGNAL(clicked()), this, SLOT(f1()) );
connect(ui-&gt;b2, SIGNAL(clicked()), this, SLOT(f2()) );
connect(ui-&gt;b3, SIGNAL(clicked()), this, SLOT(f3()) );
connect(ui-&gt;b4, SIGNAL(clicked()), this, SLOT(f4()) );
connect(ui-&gt;b5, SIGNAL(clicked()), this, SLOT(f5()) );
connect(ui-&gt;b6, SIGNAL(clicked()), this, SLOT(f6()) );
connect(ui-&gt;b7, SIGNAL(clicked()), this, SLOT(f7()) );
connect(ui-&gt;b8, SIGNAL(clicked()), this, SLOT(f8()) );

f_recommencer();
</code></pre>
<p dir="auto">}</p>
<p dir="auto">notreClasse::~notreClasse()<br />
{<br />
delete ui;<br />
}</p>
<p dir="auto">void notreClasse ::f0()<br />
{//Fonction executée lorsque l'on clique sur b0<br />
ui-&gt;b0-&gt;setText(m_laMarque); //Affiche la marque (ie X ou O)<br />
ui-&gt;b0-&gt;setEnabled(false);//désactive le bouton</p>
<pre><code>if(m_laMarque=="X")//passe de X à O ou de O à X pour le prochain coup
    m_laMarque="O";
else
    m_laMarque="X";
</code></pre>
<p dir="auto">}</p>
<p dir="auto">void notreClasse::f_recommencer()<br />
{//Cette fonction s'exécute quand on clique sur "Recommencer"<br />
//Elle remet les boutons dans leur état initial<br />
ui-&gt;b0-&gt;setText(""); //ni X ni O<br />
ui-&gt;b0-&gt;setEnabled(true); //réactive le bouton si besoin<br />
ui-&gt;b1-&gt;setText("");<br />
ui-&gt;b1-&gt;setEnabled(true);<br />
ui-&gt;b2-&gt;setText("");<br />
ui-&gt;b2-&gt;setEnabled(true);<br />
ui-&gt;b3-&gt;setText("");<br />
ui-&gt;b3-&gt;setEnabled(true);<br />
ui-&gt;b4-&gt;setText("");<br />
ui-&gt;b4-&gt;setEnabled(true);<br />
ui-&gt;b5-&gt;setText("");<br />
ui-&gt;b5-&gt;setEnabled(true);<br />
ui-&gt;b6-&gt;setText("");<br />
ui-&gt;b6-&gt;setEnabled(true);<br />
ui-&gt;b7-&gt;setText("");<br />
ui-&gt;b7-&gt;setEnabled(true);<br />
ui-&gt;b8-&gt;setText("");<br />
ui-&gt;b8-&gt;setEnabled(true);<br />
m_laMarque="X"; //Toutes les parties commencent par X<br />
}<br />
&lt;/code&gt;</p>
<p dir="auto"><strong>HEADER FILE</strong></p>
<p dir="auto">&lt;code&gt;<br />
#ifndef NOTRECLASSE_H<br />
#define NOTRECLASSE_H</p>
<p dir="auto">#include &lt;QDialog&gt;</p>
<p dir="auto">namespace Ui {<br />
class notreClasse;<br />
}</p>
<p dir="auto">class notreClasse : public QDialog<br />
{<br />
Q_OBJECT</p>
<p dir="auto">public slots:<br />
void f_recommencer();<br />
void f0();<br />
void f1();<br />
void f2();<br />
void f3();<br />
void f4();<br />
void f5();<br />
void f6();<br />
void f7();<br />
void f8();</p>
<p dir="auto">public:<br />
explicit notreClasse(QWidget *parent = 0);<br />
~notreClasse();<br />
QString m_laMarque;</p>
<p dir="auto">private:<br />
Ui::notreClasse *ui;</p>
<p dir="auto">};</p>
<p dir="auto">#endif // NOTRECLASSE_H<br />
&lt;/code&gt;</p>
<p dir="auto"><strong>ERROR MESSAGE</strong><br />
&lt;code&gt;<br />
Undefined symbols for architecture x86_64:<br />
"notreClasse::f1()", referenced from:<br />
notreClasse::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_notreclasse.o<br />
"notreClasse::f2()", referenced from:<br />
notreClasse::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_notreclasse.o<br />
"notreClasse::f3()", referenced from:<br />
notreClasse::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_notreclasse.o<br />
"notreClasse::f4()", referenced from:<br />
notreClasse::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_notreclasse.o<br />
"notreClasse::f5()", referenced from:<br />
notreClasse::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_notreclasse.o<br />
"notreClasse::f6()", referenced from:<br />
notreClasse::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_notreclasse.o<br />
"notreClasse::f7()", referenced from:<br />
notreClasse::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_notreclasse.o<br />
"notreClasse::f8()", referenced from:<br />
notreClasse::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_notreclasse.o<br />
ld: symbol(s) not found for architecture x86_64<br />
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br />
make: *** [MorpionTuto.app/Contents/MacOS/MorpionTuto] Error 1<br />
13:42:22: Le processus "/usr/bin/make" s'est terminé avec le code 2.<br />
Erreur lors de la compilation/déploiement du projet MorpionTuto (kit : Desktop Qt 5.5.0 clang 64bit)<br />
When executing step "Make"<br />
&lt;/code&gt;</p>
]]></description><link>https://forum.qt.io/topic/60530/linker-command-failed-with-exit-code-1-mac</link><generator>RSS for Node</generator><lastBuildDate>Thu, 18 Jun 2026 10:59:33 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/60530.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Nov 2015 12:57:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to linker command failed with exit code 1 - Mac on Wed, 11 Nov 2015 16:04:13 GMT]]></title><description><![CDATA[<p dir="auto">You have the "Topic Tool" button for that :)</p>
]]></description><link>https://forum.qt.io/post/297584</link><guid isPermaLink="true">https://forum.qt.io/post/297584</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 11 Nov 2015 16:04:13 GMT</pubDate></item><item><title><![CDATA[Reply to linker command failed with exit code 1 - Mac on Wed, 11 Nov 2015 13:57:35 GMT]]></title><description><![CDATA[<p dir="auto">Ho yes!<br />
Seems obvious now but the error message is not really simple at first.</p>
<p dir="auto">How should I do to mark the problem solved?</p>
<p dir="auto">Thanks a lot</p>
]]></description><link>https://forum.qt.io/post/297570</link><guid isPermaLink="true">https://forum.qt.io/post/297570</guid><dc:creator><![CDATA[Matuvu]]></dc:creator><pubDate>Wed, 11 Nov 2015 13:57:35 GMT</pubDate></item><item><title><![CDATA[Reply to linker command failed with exit code 1 - Mac on Tue, 10 Nov 2015 14:09:10 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">To add to <a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> , when you declare a slot, it's mandatory to implement it even if it doesn't do anything yet.</p>
]]></description><link>https://forum.qt.io/post/297455</link><guid isPermaLink="true">https://forum.qt.io/post/297455</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 10 Nov 2015 14:09:10 GMT</pubDate></item><item><title><![CDATA[Reply to linker command failed with exit code 1 - Mac on Tue, 10 Nov 2015 13:13:12 GMT]]></title><description><![CDATA[<p dir="auto">You did not define following methods in notreClasse class:</p>
<pre><code>void f1();
void f2();
void f3();
void f4();
void f5();
void f6();
void f7();
void f8();
</code></pre>
]]></description><link>https://forum.qt.io/post/297449</link><guid isPermaLink="true">https://forum.qt.io/post/297449</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 10 Nov 2015 13:13:12 GMT</pubDate></item></channel></rss>