2012-01-02 34 views
1

我正在编写一个需要与某些外部汇编程序函数接口的操作系统。我把声明的标题:为'gdt_flush'指定的存储类别

namespace Kernel 
{ 
    class DescriptorTables 
    { 
     public: 
     void init(); 
     void gdt_set_gate(s32int,u32int,u32int,u8int,u8int); 
     private: 
     extern void gdt_flush(u32int); 
     struct gdt_entry_struct 
     { 
     //... 

当代码运行时,它产生

DescriptorTables.h:10:31: error: storage class specified for 'gdt_flush'

我从来没有见过这个错误,就如何解决这一问题的任何想法?

+0

我不完全确定你想要'gdt_flush()'来实现,但我最好的猜测是你想重新实现它的功能;为此,你需要'虚拟'。 – Olipro 2012-01-02 05:48:19

回答

2
extern void gdt_flush(u32int); 

你不能说类似于一个班级中的externextern是一个存储类,它解释了您所看到的消息。

+0

谢谢你的回答! – 2012-01-02 05:38:05