<?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[error: &#x27;Layer&#x27; was not declared in this scope]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich hab in meiner Neuronen Klasse eine Methode die als Parameter einen vector vom Typ Layer bekommt (Zeile 23). Dafür habe ich auch die Layer.h eingebunden. Allerdings bekomme ich trotzdem die Fehlermeldung:<br />
line 23 error: 'Layer' was not declared in this scope</p>
<p>Neuron.h:</p>
<pre><code>#ifndef NEURON_H
#define NEURON_H

#include &lt;vector&gt;
#include &quot;Layer.h&quot;

using namespace std;

class Neuron
{

private:
    double state;
    double inputSum;    //Summer aller Inputs
    vector&lt; vector&lt;int&gt; &gt; inputPosition;  //Die Adresse des Senders [Nummer des Inputs, 0] = Layer; [Nummer des Inputs, 1] = Position;
    vector&lt;double&gt; weight;  //Das dazugehörige weight

public:
    Neuron();
    void addInput(const vector&lt;int&gt; &amp;senderID);
    void getInputs(const vector&lt;Layer&gt; &amp;layers);

    //Debug
    void printInfo(int layer, int position);
};

#endif // NEURON_H
</code></pre>
<p>Ich hab mal ein bisschen im Internet rumgeschaut und keine Lösung gefunden die auf mein Problem zutrifft.<br />
Vielleicht ist es grad auch einfach nur zu spät und ich steh ein bisschen auf dem Schlauch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> .</p>
<p>Ich hoffe ihr könnt mir weiterhelfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/334891/error-layer-was-not-declared-in-this-scope</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 02:30:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/334891.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 18 Oct 2015 20:14:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to error: &#x27;Layer&#x27; was not declared in this scope on Sun, 18 Oct 2015 20:14:37 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich hab in meiner Neuronen Klasse eine Methode die als Parameter einen vector vom Typ Layer bekommt (Zeile 23). Dafür habe ich auch die Layer.h eingebunden. Allerdings bekomme ich trotzdem die Fehlermeldung:<br />
line 23 error: 'Layer' was not declared in this scope</p>
<p>Neuron.h:</p>
<pre><code>#ifndef NEURON_H
#define NEURON_H

#include &lt;vector&gt;
#include &quot;Layer.h&quot;

using namespace std;

class Neuron
{

private:
    double state;
    double inputSum;    //Summer aller Inputs
    vector&lt; vector&lt;int&gt; &gt; inputPosition;  //Die Adresse des Senders [Nummer des Inputs, 0] = Layer; [Nummer des Inputs, 1] = Position;
    vector&lt;double&gt; weight;  //Das dazugehörige weight

public:
    Neuron();
    void addInput(const vector&lt;int&gt; &amp;senderID);
    void getInputs(const vector&lt;Layer&gt; &amp;layers);

    //Debug
    void printInfo(int layer, int position);
};

#endif // NEURON_H
</code></pre>
<p>Ich hab mal ein bisschen im Internet rumgeschaut und keine Lösung gefunden die auf mein Problem zutrifft.<br />
Vielleicht ist es grad auch einfach nur zu spät und ich steh ein bisschen auf dem Schlauch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> .</p>
<p>Ich hoffe ihr könnt mir weiterhelfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2471526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2471526</guid><dc:creator><![CDATA[The_DoubleD]]></dc:creator><pubDate>Sun, 18 Oct 2015 20:14:37 GMT</pubDate></item><item><title><![CDATA[Reply to error: &#x27;Layer&#x27; was not declared in this scope on Sun, 18 Oct 2015 20:21:53 GMT]]></title><description><![CDATA[<p>Ohne die Layer Klasse zu kennen, wird dir hier wohl keiner was genaues sagen können.<br />
Vermutlich aber ein zirkulärer Include. Um das zu fixen entfernt man üblicherweiße den Include im Header, fügt ihn in der cpp ein und Forwarddeclariert im Header die benötigte Klasse.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2471528</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2471528</guid><dc:creator><![CDATA[JulianH]]></dc:creator><pubDate>Sun, 18 Oct 2015 20:21:53 GMT</pubDate></item><item><title><![CDATA[Reply to error: &#x27;Layer&#x27; was not declared in this scope on Sun, 18 Oct 2015 20:24:54 GMT]]></title><description><![CDATA[<p>Hier die Layer.h :</p>
<pre><code>#ifndef LAYER_H
#define LAYER_H

#include &lt;vector&gt;
#include &quot;Neuron.h&quot;

using namespace std;

class Layer{

private:
    vector&lt;Neuron&gt; neurons;

public:
    Layer(int numberOfNeurons);
    void addConnection(const int &amp;senderLayer, const int &amp;senderPosition, const int &amp;receiverPosition);
    int getNumberOfNeurons();
    void activateNeuronInputs(const vector&lt;Layer&gt; &amp;layers);

    //Debug
    void printNeuronInfo(int layer, int position);
};

#endif // LAYER_H
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2471530</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2471530</guid><dc:creator><![CDATA[The_DoubleD]]></dc:creator><pubDate>Sun, 18 Oct 2015 20:24:54 GMT</pubDate></item><item><title><![CDATA[Reply to error: &#x27;Layer&#x27; was not declared in this scope on Sun, 18 Oct 2015 20:28:51 GMT]]></title><description><![CDATA[<p>Zirkulare Abhängigkeit. Aber dein Neuron braucht gar nicht die vollständige Definition von Layer, eine Forward-Deklaration reicht auch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2471533</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2471533</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 18 Oct 2015 20:28:51 GMT</pubDate></item><item><title><![CDATA[Reply to error: &#x27;Layer&#x27; was not declared in this scope on Sun, 18 Oct 2015 20:37:27 GMT]]></title><description><![CDATA[<p>Danke jetzt tuts.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2471537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2471537</guid><dc:creator><![CDATA[The_DoubleD]]></dc:creator><pubDate>Sun, 18 Oct 2015 20:37:27 GMT</pubDate></item><item><title><![CDATA[Reply to error: &#x27;Layer&#x27; was not declared in this scope on Sun, 18 Oct 2015 20:47:40 GMT]]></title><description><![CDATA[<p>Du hast nen zirkulären Include.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2471538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2471538</guid><dc:creator><![CDATA[JulianH]]></dc:creator><pubDate>Sun, 18 Oct 2015 20:47:40 GMT</pubDate></item></channel></rss>