I have a code in which am trying to use outportb(), but while compiling it on MinGw i am getting below error.
C:\Users\A_TOMAR开发者_C百科\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;
}
I would like to know which header file is having this particular function?
- Windows doesn't provide access to a hardware. You should use Win32 API calls.
- This function is DOS specific and unavailable in Windows
Googling shows that your solution is inpout32.dll (example with weird font color)
#include <pc.h>
void outportb(unsigned short _port, unsigned char _data);
精彩评论