unix g++에서 컴파일할때는 아무 문제 없다가
dev-c++이 좋다길래 PC에서 컴파일할려고 하는데
무수한 에러만 보이네요.
dev-c++에서 c++코드 컴파일하려면 어떤 옵션을 변경해야하나요?
참고로 아래같은 코드조차 별 이상한 에러들이 나면서 컴파일이 안됩니다.
#include <iomanip>
#include "graph-adj.h"
using namespace std;
//const double Graph::NO_EDGE = 1.0e100; //define NO_EDGE's value
for class
const bool Graph::NO_EDGE = false;
void Graph::SetSize(int n)
{
myA.SetDimensions(n,n);
for (int o = 0; o < myA.size(); ++o)
for (int d = 0; d < myA.size(); ++d) {
myA[o][d] = NO_EDGE;
}
}
void Graph::AddEdge(int origin, int destination, bool value)
{
if ((myA[origin][destination] ==
NO_EDGE)&&(myA[destination][origin] == NO_EDGE))
++myNumEdges;
myA[origin][destination] = value;
myA[destination][origin] = value;
}
void Graph::RemoveEdge(int origin, int destination)
{
if ((myA[origin][destination] !=
NO_EDGE)&&(myA[destination][origin] != NO_EDGE))
--myNumEdges;
myA[origin][destination] = NO_EDGE;
myA[destination][origin] = NO_EDGE;
}
bool Graph::HasEdge(int origin, int destination) const
{
return myA[origin][destination] != NO_EDGE;
}
bool Graph::EdgeValue(int origin, int destination) const
{
return myA[origin][destination];
}
ostream& operator<<(ostream &os, const Graph &g)
{
os << " ";
for (int d = 0; d < g.NumNodes(); ++d)
os << setw(4) << d;
os << endl;
for (int o = 0; o < g.NumNodes(); ++o)
{
os << setw(4) << o;
for (int d = 0; d < g.NumNodes(); ++d)
if (g.myA[o][d] == Graph::NO_EDGE)
os << " ";
else
os << setw(4) << g.myA[o][d];
os << endl;
}
return os;
}
int Graph::NodeUnDegree(int node) const
{
int i, total=0;
for(i=0; i < NumNodes(); i++) {
if (myA[i][node] != NO_EDGE) total++;
}
return total;
}
int Graph::NodeInDegree(int node) const
{
int i, total=0;
for(i=0; i < NumNodes(); i++) {
if (myA[i][node] != NO_EDGE) total++;
}
return total;
}
int Graph::NodeOutDegree(int node) const
{
int i, total=0;
for(i=0; i < NumNodes(); i++)
if (myA[node][i] != NO_EDGE) total++;
return total;
}
int Graph::NodeDegree(int node) const
{
return NodeInDegree(node) + NodeOutDegree(node);
//return NodeUnDegree(node);
}