0

I am working with following header definition.

finstrumentor.hpp

#ifndef _FINSTRUMENTOR_HPP_
#define _FINSTRUMENTOR_HPP_

#include "../../../api/probe_API.hpp"
#include <cstdint>

extern Instrumentor* INSTRUMENTOR_INSTANCE;

typedef void (*instrumentation_func)(uint16_t);

class Probe_Info {

  public :
    uint8_t* patch_addr;
    uint8_t size;
};

class Statistics {

  public:
    uint64_t addr;
    uint64_t count;

};

class Finstrumentor : public Instrumentor {

  protected :
    void (*prolog_func)(uint16_t);
    void (*epilog_func)(uint16_t);

  public :
    Finstrumentor(instrumentation_func prolog_func, instrumentation_func epilog_
    void initialize(Instrumentor* inst);
    virtual ~Finstrumentor();

};

/* Global Data */
typedef std::unordered_map<int, std::list<Probe_Info*>*> probe_map;
extern probe_map probe_info;

typedef std::map<uint64_t, uint16_t> func_table;
extern func_table functions;

extern uint16_t func_id_counter;

Statistics* global_stats;


#endif /* _FINSTRUMENTOR_HPP_ */

When I include this file I get the following error during compilation.

In file included from ../src/instrumentor.cpp:4:
../src/finstrumentor.hpp: At global scope:
../src/finstrumentor.hpp:43: error: expected initializer before ‘<’ token
../src/finstrumentor.hpp:44: error: ‘probe_map’ does not name a type
../src/finstrumentor.hpp:46: error: expected initializer before ‘<’ token
../src/finstrumentor.hpp:47: error: ‘func_table’ does not name a type
../src/cyg_functions.cpp:16: error: ‘probe_map’ does not name a type
../src/cyg_functions.cpp:17: error: ‘func_table’ does not name a type
Cœur
  • 37,241
  • 25
  • 195
  • 267
chamibuddhika
  • 1,419
  • 2
  • 20
  • 36

1 Answers1

2

You haven't included the headers that define list, map and unordered_map.

#include <list>
#include <map>
#include <unordered_map>

Also, you shouldn't use reserved names like _FINSTRUMENTOR_HPP_. You should (at least) remove the underscore from the beginning.

Community
  • 1
  • 1
Mike Seymour
  • 249,747
  • 28
  • 448
  • 644