gpt4 book ai didi

c - 在 C 中引用 outportb() 函数时出现问题

转载 作者:行者123 更新时间:2023-11-30 14:27:45 24 4
gpt4 key购买 nike

我有一段代码试图使用 outportb(),但在 MinGw 上编译它时出现以下错误。

C:\Users\A_TOMAR\AppData\Local\Temp\ccYPvctv.o:dsp.c:(.text+0x68): undefined reference to `outportb'
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>

int main(void)
{
outportb(0x378,0xFF);
return 0;
}

我想知道哪个头文件具有此特定功能?

最佳答案

  1. Windows 不提供对硬件的访问。您应该使用 Win32 API 调用。
  2. 此功能是 DOS 特有的,在 Windows 中不可用

谷歌搜索显示您的解决方案是 inpout32.dll ( example with weird font color )

关于c - 在 C 中引用 outportb() 函数时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7317871/

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