Hello,
I'm trying to use a source code to run on Vista or 98 but my compiler Dev-C++ gives several problem messages about the libraries and other errors. I suppose the errors occur because the compiler doesn't see the libraries. Below is the source code and errors that occurs in it. What do you suggest to do to get rid of them, is there a way to add these libraries to Dev-C++?
Code:
#include <dos.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include <bios.h>
#include "My_TPU.h"
int LPT1, Base_Address;
unsigned char Data_Byte, High_Nibble, Low_Nibble;
unsigned char Read_Switches(void)
{
unsigned char High_Niblle, Low_Niblle;
outport(Base_Address + 2,inport(Base_Address + 2) ||15);
delay(50);
Low_Nibble = inport(Base_Address + 2);
High_Nibble = inport(Base_Address + 1);
Low_Nibble = Low_Nibble & 0x0F;
High_Nibble = High_Nibble & 0x0F;
Data_Byte = High_Nibble | Low_Nibble;
return(Data_Byte);
}
void Display_Data(unsigned char Data_Byte)
{
gotoxy(1,3); printf("LPT1 = %i Data Byte = %i \n",LPT1,Data_Byte);
}
void main()
{
.clrscr();
Base_Address = 1024; LPT1 = peek(0, Base_Address + 8);
do
{
Data_Byte=Read_Switches();
Display_Data(Data_Byte);
}while(!kbhit());
}
bios.h: No such file or directory.
My_TPU.h: No such file or directory.
In function `unsigned char Read_Switches()':
15 `inport' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
`outport' undeclared (first use this function)
16 `delay' undeclared (first use this function)
`void Display_Data(unsigned char)':
26 `gotoxy' undeclared (first use this function)
26 At global scope:
29 `main' must return `int'
`int main(...)':
30 expected primary-expression before '.' token
31 `peek' undeclared (first use this function)