我有一段代码试图使用 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;
}
我想知道哪个头文件具有此特定功能?
最佳答案
- Windows 不提供对硬件的访问。您应该使用 Win32 API 调用。
- 此功能是 DOS 特有的,在 Windows 中不可用
谷歌搜索显示您的解决方案是 inpout32.dll ( example with weird font color )
关于c - 在 C 中引用 outportb() 函数时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7317871/