문제가 있습니다. 그러나 무엇인지 모르겠습니다. 내 코드를 컴파일 할 때 오류가 발생합니다 (일부 gnuplot이 관련되어 있음).멋진 벡터로 오류를 선언하는 프로토 타입
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <string>
#include <math.h>
#include "gnuplot_i.hpp"
using namespace std;
typedef struct DATA{
char Label[50]; //title
vector<double> y,SD; //y data point SD sigma
}DATA;
typedef map<int, double> Episode;
typedef map<int, Episode> Stat_run;
double GetAvg(double *Array, int Count, double *stddev);
void wait_for_key();
void plotMyLines(DATA *Data, vector< std::map<int, map<int, double> > > Points, int printsteps, double Y1, double Y2, int episode, int run);
void PlotLines(const char *Outfile, vector<double> x, DATA *Data, int Lines, const string &xlabel, const string &ylabel, double Y1, double Y2);
int main()
{
vector<Stat_run> Points;
Stat_run exp1; Episode eps;
Stat_run exp2; Episode eps2;
}
대부분의 코드가 삭제되었습니다. 목표는 일부 결과를 플로팅 기능으로 보내도록 형식을 지정하는 것입니다. 나는 단순한 오류를 보았지만 2 시간의 테스트 후에는 내 문제가 어디인지 찾을 수 없습니다. 오류 :
error: expected ‘,’ or ‘...’ before ‘-’ token
이 오류는 plotMyLines 및 PlotLines의 프로토 타입에 대해 나타납니다. 어떤 힌트를 주셔서 감사합니다!
코드 조각은 당신이 어떤 컴파일러 정보를 추가 할 수 있습니다 GCC 4.6.1와 잘 컴파일 같은 다음 컴파일합니다. 또한 C 스타일의 struct 정의를 사용하는 이유는 무엇입니까? – pmr