【发布时间】:2011-07-11 13:02:47
【问题描述】:
我正在用 C++ 制作一个神经网络,但我遇到了一个严重的问题,包括头文件 看看这段代码:
神经元.cpp:
//NEURONE.CPP
#include "stdafx.h"
#include "Neurone.h"
#include <cmath>
using namespace std;
Neurone::Neurone(Layer* current,Layer* next)
{
}
Neurone.h:
//NEURONE.H
#ifndef _NEURONE_H
#define _NEURONE_H
#include <vector>
#include "Layer.h"
class Neurone
{
public:
Neurone(Layer* current,Layer* next);
private:
};
#endif
图层.cpp:
// LAYER.CPP
#include "stdafx.h"
#include <vector>
#include "Layer.h"
using namespace std;
Layer::Layer(int nneurone,Layer &neighborarg)
{
}
图层.h:
//LAYER.H
#ifndef _LAYER_H
#define _LAYER_H
#include <vector>
#include "Neurone.h"
class Layer
{
public:
Layer(int nneurone,Layer &neighborarg);
//ERROR :C2061 Layer:Syntax error :Bad identifier
private:
//std::vector <Neurone*> NeuronesInLayer;
Neurone ANeuron;
//ERROR :C2146 Syntax error :wrong identifier
};
#endif
Main.cpp:
//MAIN.CPP
#include "Neurone.h"
//#include "Layer.h"
int main()
{
return 0;
}
我使用 VC++2010,但我无法理解为什么类 Layer 无法识别我的类 Neurone。 任何人都可以帮助我吗? 谢谢,
【问题讨论】:
-
40 分钟前提出了几乎相同的问题!
-
这个人称他们为“循环”,怀疑他的搜索结果是“循环”
-
非常感谢您的回答和链接,现在可以使用了。