# Declared but not defined

**URL:** <https://root-forum.cern.ch/t/declared-but-not-defined/33486>\
**Category:** Newbie\
**Created:** [April 7, 2019, 3:42am UTC](https://root-forum.cern.ch/t/declared-but-not-defined/33486 "2019-04-07T03:42:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prya13](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ea666f/32.png) [@Prya13](https://root-forum.cern.ch/u/Prya13)\
**Post date:** [April 7, 2019, 3:42am UTC](https://root-forum.cern.ch/t/declared-but-not-defined/33486/1 "2019-04-07T03:42:58Z")

</div>

Hey All,

I have a file with seven columns and am trying to plot a TGraph using only the first two columns using this macro below but this error: Processing goodrunstime.C…  
Error: goodrunstime() declared but not defined :0:

```auto
#include <fstream>
#include <iostream>

void goodrunstime();
{
  ifstream infile;
  string line;
  infile.open("goodruns.out");
  const int n = 800;
  int runNumber[n], runlength[n];                                                                                                                                                                                                             
  int i =0;
  while(getline(infile,line))
  {
    int col1, col2;
    std::istringstream ss(line);
    ss >> col1 >> col2 ;
    cout << "Run Number " << col1 << "runLength " << col2 << std::endl;
    runNumber[i]= col1 ;
    runlength[i]= col2;
    i++;
  }

  TGraph *plot = new TGraph(n,runNumber,runlength);
    plot->Draw("ACP");

}

```

How can I resolve this error?  
Looking forward to your kind assistance.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [April 7, 2019, 4:41am UTC](https://root-forum.cern.ch/t/declared-but-not-defined/33486/2 "2019-04-07T04:41:14Z")

</div>

Remove the first semicolon:

```auto
void goodrunstime()
{
    ifstream infile;
   ... etc

```

---

<div class="post-metadata">

**Author:** ![Prya13](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ea666f/32.png) [@Prya13](https://root-forum.cern.ch/u/Prya13)\
**Post date:** [April 7, 2019, 9:04pm UTC](https://root-forum.cern.ch/t/declared-but-not-defined/33486/3 "2019-04-07T21:04:12Z")

</div>

Thank you dastudillo, it worked.
