<分区>
我正在用 C++ 制作一个神经网络,但我遇到了一个严重的标题问题,包括 看看这段代码:
神经元.cpp:
//NEURONE.CPP
#include "stdafx.h"
#include "Neurone.h"
#include <cmath>
using namespace std;
Neurone::Neurone(Layer* current,Layer* next)
{
}
神经元.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
主要.cpp:
//MAIN.CPP
#include "Neurone.h"
//#include "Layer.h"
int main()
{
return 0;
}
我使用的是 VC++2010,但我不明白为什么我的 Neurone 类无法被 Layer 类识别。 有人可以帮我吗? 谢谢,