//#include “parser.h”
#include <malloc.h>
#include <time.h>
//#include “kmacs.h”
#include
#include
#include
#include
#include
#include “kvec.h”
#include
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include
#include <unordered_map>
#include
#include “sais.h”
#include
#include “libbsc/bsc.h”
#include “include/gpu_lcp.h”
#include “suffix_array.h”
#include
#include
#include <sys/types.h>
#include<string.h>
#include <dirent.h>
#include
#include <sys/stat.h>
#include <fcntl.h>
using namespace std;
#define table_size 10000;
#define MOD_ADLER 65521;
int location_length, filelen,reflen;
char *buffer, *refcode, *tarcode;
//char *refcode;
int HashTable[1<<28] = {-1};
int *loca, *file_len;
bool flag_hash = true;
bool flag_fir = true;
bool ProcessFile(char *file);
bool ProcessFile(char *file){
int offset = 0;
FILE *tp = fopen(file,“r”);
fseek(tp, 0, SEEK_END);
int length = ftell(tp);
//char buffer[length];
buffer = new char[length];
fseek(tp, 0, SEEK_SET);
fread(buffer, length, 1, tp);
for (size_t a = 0; a < length; a++)
{
refcode[filelen+a] = buffer[a];
//filelen ++;
}
int abslen = 0, hashkey,key;
/for (size_t b = filelen; b < filelen + length; b++)
{
}/
std::string sub_str(refcode + filelen, refcode+ filelen + 20);
hashkey = std::hashstd::string{}(sub_str);
key = hashkey %(1 << 28);
loca[filelen] = HashTable[key];
HashTable[key] = filelen;
for (size_t b = filelen + 1; b < filelen + length; b++)
{
std::string sub_str(refcode + b, refcode + b + 20);
}
}
这段代码中,为什么依然存在“no member named ‘hash’ in namespace ‘std’”和“expected '(' for function-style cast or type construction”的问题