# Cling interface function

**URL:** <https://root-forum.cern.ch/t/cling-interface-function/31761>\
**Category:** Newbie\
**Created:** [November 26, 2018, 12:18am UTC](https://root-forum.cern.ch/t/cling-interface-function/31761 "2018-11-26T00:18:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsaklid](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/i/eb9ed0/32.png) [@itsaklid](https://root-forum.cern.ch/u/itsaklid)\
**Post date:** [November 26, 2018, 12:18am UTC](https://root-forum.cern.ch/t/cling-interface-function/31761/1 "2018-11-26T00:18:32Z")

</div>

Hi everyone!

I just finished writing my first actual script, but when I’m trying to run it in ROOT with " .x read\_to\_vectors.C " I get this message:

IncrementalExecutor::executeFunction: symbol ‘\_Z15read\_to\_vectorsv’ unresolved while linking [cling interface function]!  
You are probably missing the definition of read\_to\_vectors()  
Maybe you need to load the corresponding shared library?

Ubuntu: 18.04  
gcc : 7.3.0

Since this is my very first script I don’t really know if I made a terrible mistake or if it’s my system’s fault. Could someone please give me a hint ?

P.S. this forum has been a great help ! Thank you all very much!!

```auto
read_to_vectors.C
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include "TGraph.h"
#include "TFile.h"
using namespace std;
void read_to_vectors();
int main()
{
  vector<float> vecCounts, vecTime, veccps;
  float counts, time;
  Int_t dim =32;
  ifstream inputFile("data12.txt");
    while (inputFile >> time >>counts)
      {
       	vecTime.push_back(time);
	vecCounts.push_back(counts);
      }

  for (int i(0); i< vecCounts.size(); i++)
  {
    veccps.push_back(vecCounts[i]/60);
    vecTime[i]=vecTime[i]+0.5;

  cout << vecTime[i] << " " <<veccps[i] << endl;
  }
  TFile *file = new TFile("Graph1.root","RECREATE");
  TGraph *gr1 = new TGraph (dim , &vecCounts[0], &vecTime[0]);
  gr1->Draw("A*");
  return 0;
}

```

Ilias

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [November 26, 2018, 8:28am UTC](https://root-forum.cern.ch/t/cling-interface-function/31761/2 "2018-11-26T08:28:04Z")

</div>

Hi Ilias,

the problem is that the function `read_to_vectors` has no implementation and cling is erroring out because of that.

Cheers,  
D

---

<div class="post-metadata">

**Author:** ![itsaklid](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/i/eb9ed0/32.png) [@itsaklid](https://root-forum.cern.ch/u/itsaklid)\
**Post date:** [November 26, 2018, 9:40pm UTC](https://root-forum.cern.ch/t/cling-interface-function/31761/3 "2018-11-26T21:40:00Z")

</div>

I replaced the “int main()” line with “int read\_to\_vectors()” and it worked.

Thanks a lot!!
