シンタックス エラー C2061 についてしばらく調べていたところ、ヘッダー ファイルの循環依存関係が原因であることが多いことがわかりました。ただし、ファイルでこれを解決する必要があったと思いますが、引き続き問題が発生します。
アーチ
#pragma once
#include <string>
using namespace std;
class Node;
class Arc
{
public:
Arc(Node &p_destination, const string &p_mode);
~Arc();
private:
string m_mode;
Node* m_destination;
};
Node.h
#pragma once
#include <string>
#include <vector>
using namespace std;
class Arc;
class Node
{
public:
Node(const string &p_name, const int &p_identifier, const float &p_latitude, const float &p_longitude);
~Node();
void set_arcs(Arc* p_arc) { m_arcs.push_back(p_arc); } //Line that causes the error
private:
std::vector<Arc*> m_arcs;
//Other Private Variables removed
};
ヘッダー ファイルは両方とも、対応する cpp ファイルに含まれています。この問題に関するヘルプは大歓迎です!
編集:以下の完全なエラーメッセージ
"Syntax Error: identifier 'Arc'"