Hi there,

I am a Delphi guy and I am a bit new to C++. I have this annoying error when I try to compile and I have no idea how to solve this:
error: request for member ‘GetVector’ in ‘gff’, which is of non-class type ‘TGff_File*’ on line #20 .

My guess is that it has to do something with pointers but I am lost...

Could you please tell me what is wrong here ?

Thank you for your help,

Pasta


MyProg.cpp

#include "GFF_parse.h"

#include <iostream>
#include <fstream>
#include <sstream>
#include <string.h>
#include <time.h>



using namespace std;

void ReadVector(vector<TGff_Feature> AVect);


main(){
  
   TGff_File* gff = new TGff_File();
   
   ReadVector( gff.GetVector() ); //error here !
  
  
}

GFF_parse.h

#ifndef GFF_PARSE_H_INCLUDED
#define GFF_PARSE_H_INCLUDED

#include <iostream>
#include <fstream>
#include <sstream>
#include <string.h>
#include <vector>


class TGff_Feature;
class TGff_File;



class TGff_File
{

    public:
        TGff_File(std::string FileName);
        virtual ~TGff_File();
	const std::vector<TGff_Feature> GetVector() { return fFeatureVect };

    protected:

    private:
        std::string fFileName;
        std::vector<TGff_Feature> fFeatureVect;
        int ParseGFF();

};


class TGff_Feature
{
    public:
        TGff_Feature(std::string _Seqname, std::string _FeatType, int _Start, int _End, char _Strand );
        virtual ~TGff_Feature();

    protected:

    private:
        std::string fSeqname;        
        std::string fFeatureType;
        int fStart;
        int fEnd;        
        char fStrand;
};

GFF_parse.cpp

#include "GFF_parse.h"

#include <typeinfo>
#include <math.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <exception>
#include <string.h>
#include <stdlib.h>

using namespace std;




TGff_File::TGff_File(std::string FileName)//cons
{
    fFileName = FileName;
    ParseGFF();

}


TGff_File::~TGff_File(){ //dest

}



int TGff_File::ParseGFF(){

    /* Initialize vector here and fill it */
    
    return 1;
}




TGff_Feature::TGff_Feature(string _Seqname, string _FeatType, int _Start, int _End, char _Strand ) {
    fSeqname = _Seqname;
    fFeatureType = _FeatType;
    fStart = _Start;
    fEnd = _End;
    fStrand = _Strand;


}

TGff_Feature::~TGff_Feature(){


}

SOLVED !

Figured it out myself LOL
The solution is ReadVector( gff->GetVector() );
Note the use of -> cos' it is a pointer Dooooooh !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.