gpt4 book ai didi

c++ - 为 'gdt_flush' 指定的存储类

转载 作者:行者123 更新时间:2023-11-30 04:30:26 25 4
gpt4 key购买 nike

我正在编写一个需要与一些外部汇编程序接口(interface)的操作系统。我把声明放在标题中:

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'

我以前从未见过这个错误,关于如何解决这个问题有什么想法吗?

最佳答案

    extern void gdt_flush(u32int);

你不能在类中这样说externextern 是一个存储类,它解释了您看到的消息。

关于c++ - 为 'gdt_flush' 指定的存储类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8697725/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com