The compiler can't find <dos.h>, how to add it?
The dos.h header is not a standard header in PellesC...
If you have a dos.h and the corresponding dos.lib you would put it into a folder and add it using
the quoted version of #include...
For example if you put it in d:\CProjects\Dos
#include "D:\CProjects\Dos\dos.h"
Then in your linker options you would add D:\CProjects\Dos\dos.lib or you could use
#pragma lib("D:\CProjects\Dos\Dos.lib")
right under your #include statement in your source file.
Sorry, can you guide me what to do step by step?
the library is here: C:\TC\INCLUDE\DOS.H, how to link? thanks.
Just follow the steps I already gave you...
However, if that's a Turbo C library it's unlikely you can use it since TC is 16 bits...
// at the top of each C file that needs it...
#include "c:\tc\include\dos.h"
//at the top of your main C file
#pragma lib "c:\tc\lib\dos.lib"
#include "c:\tc\include\dos.h"
#include<stdio.h>
#pragma lib "c:\tc\lib\dos.lib"
int main()
{
int x=1,y;
do{
printf("%d\n", x);
for(y=1;y<100000000;y++);
x++;
if (x==100000)
{
printf("DONE :D\n\n");
break;
}
} while (x>0);
}
Like that? It shows an error: "c:\tc\include\dos.h(13): fatal error #1035: Can't find include file <_defs.h>."
Your other option is to include the c:\tc\lib and c:\tc\include folders in your project search paths.
Project -> Project Options -> Folders ....
You may still need the #pragma ... though.