0
我有一個硬件類,它有一個指向TLB類對象的指針,並在構造函數中初始化它。但是,Codeblocks(GNU GCC)給了我錯誤 「proj3_hardware.h | 15 |錯誤:'TLB'沒有命名類型' 」proj3_hardware.h | 15 | error:expected';'在'*'標記之前指向拋出對象類的指針「不命名類型」
我只是看不到代碼中的錯誤。謝謝。
proj3_hardware.h
#include <iostream>
#include "proj3_globals.h"
#include "proj3_pagetable.h"
#include "proj3_tlb.h"
class Hardware{
public:
// Defines the hardware parts
int global_simulation_time;
TLB* tlb;
PageManagement* pagemm;
// Hardware constructor and methods
Hardware(int pageTableType, int replacementAlgo);
void execute();
void diskaccess();
};
proj3_tlb.h
#include <iostream>
#include "proj3_globals.h"
// Assumes that the TLB is using LRU
class TLBEntry{
public:
char validEntry;
int VirtualAddress;
int PhysicalAddress;
long LastUsed;
};
class TLB{
private:
TLBEntry entries[HARDWARE_TLBSIZE];
int* simulation_time;
public:
TLB(int* simulation_time);
void tlb_add(int virtualaddress, int physicaladdress);
int tlb_lookup(int virtualaddress);
void tlb_flush();
};
你明白了......頭球衛是問題所在。 – JaLooNz 2010-11-20 15:24:53