Error: variable-sized object may not be initialized TChain

Error: variable-sized object may not be initialized TChain *gpChain[i] = new TChain(gpTreeNames[i]); 

WHAT CAN I DO TO TAKE THIS ERROR OFF MY CODE ? THANKS

 //Make gpChains
    TString gpChainNames[] = {"p100GeV", "p250GeV", "p500GeV", "p750GeV", "p1TeV", "p2TeV", "p5TeV", "p7hTeV", "p10TeV", "p12hTeV", "p15TeV", "p30TeV", "p45TeV", "p60TeV", "p70TeV", "p80TeV", "p90TeV"};
    
    TString gpTreeNames[] = {"t","t","t", "mcevent", "t", "t", "mcevent", "mcevent", "mcevent", "mcevent", "mcevent", "mcevent", "mcevent", "mcevent", "mcevent", "mcevent", "mcevent"};
    const int gpSize = sizeof(gpChainNames)/sizeof(*gpChainNames);
    
    TChain **gpChain = new TChain*[gpSize];
    TString gpFileNames[gpSize], gpHistNames[gpSize], gpFitNames[gpSize], gpTitleNames[gpSize];
    for (int i = 0; i < gpSize; i++) {
      gpFileNames[i] = gpChainNames[i];
      gpFileNames[i].Insert(1,"_");
      gpFileNames[i].ReplaceAll("h",".5");
      
      gpHistNames[i] = gpChainNames[i];
      gpHistNames[i].Prepend("h");
      
      gpFitNames[i] = gpChainNames[i];
      gpFitNames[i].Prepend("f");

      gpTitleNames[i] = gpChainNames[i];
      gpTitleNames[i].Remove(0,1);
      gpTitleNames[i].ReplaceAll("h",".5");
      gpTitleNames[i].Append(" Protons (" + TrigTxt + " MeV Threshold)");
      
     TChain *gpChain[i] = new TChain(gpTreeNames[i]);
      TString path = TString::Format("%s%s%s","/home/nutters/Tyler/RunsJan2018/SingleEnergy/New/",gpFileNames[i].Data(),".root");
      gpChain[i]->Add(path);
      gpChain[i]->SetLineColor(kBlack);
      gpChain[i]->SetLineWidth(2);
      
      //create friends for sparsified output
      gpChain[i]->Process("/home/nutters/Tyler/EnergyMeasurement/testDraw/G4CALFriendMaker.C+",gpChainNames[i]);
      
      //add them as a friend now
      gpChain[i].AddFriend("g4ff",gpChainNames[i]+"_G4CALFriend.root");
    }

You must not redefine variables ("TChain gpChain" versus “TChain **gpChain”) then, “TChain(gpSize)” makes no sense and you should have “gpChain[i] = new TChain(gpTreeNames[i]);” (i.e. no “TChain *” in front of it).

Thanks, I know about that error but that wasn’t the error I was talking about. The error is in the for-loop.

TChain *gpChain[i] = new TChain(gpTreeNames[i]);