What's wrong with this code?
I am trying to write a value 54 to parrallel port and then read it back and put it in a variable, from my research the following code should work provided i have inpout32.dll in my windows/system directory (Which i have):
Code:
#include <iostream>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
/* ----Prototypes of Inp and Outp--- */
short _stdcall Inp32(short PortAddress);
void _stdcall Out32(short PortAddress, short data);
int main()
{
short PortVal;
Out32(0x378,54);
PortVal = Inp32(0x378);
}
Well that code won't even compile in Dev C++... I get compiler error:
[Linker error] undefined reference to `_Z5Out32ss@8'
[Linker error] undefined reference to `_Z5Inp32s@4'
ld returned 1 exit status
....[Build Error] [port1.exe] Error 1
Do i need another compiler or the code is just wrong?