error

Hello,

Getting error when trying to compile a C program:

1
2
3
4
  g++ Documents/firstchess.c
Documents/firstchess.c:18:19: fatal error: conio.h: No such file or directory
 #include <conio.h>
That error seems very simple. What exactly don't you understand? It appears to me that your modern compiler doesn't use this ancient DOS header file.

Last edited on
That is because conio is non-standard and is not supported by all compilers.
Yep, but I want to get that program to work. Thx
Then either get a new different compiler or use a standard library.
Last edited on
Use a standard library?

How?
What is it you're trying to use conio.h for?

Can't tell you how to use a standard library if we don't know what you're using in <conio.h>.
I don`t know because I have not written the code, which is btw too long to be posted here. Here is the source: http://devwebcl.atarionline.pl/cc65/
If you haven't written the code, then why do you need the <conio.h> header?
I don`t need it, it is included in the code. The program just doesn`t compile.

1
2
3
4
5
 g++ Documents/firstchess.c
Documents/firstchess.c:18:19: fatal error: conio.h: No such file or directory
 #include <conio.h>
                   ^
compilation terminated.


btw if you want to look at the code just download firstchess.c from the link I posted above.
Last edited on
> I don`t need it
then don't include it.
Here is the problem: if I remove it then I get this error message:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  gcc Documents/firstchess.c -o firstchess
Documents/firstchess.c: In function ‘Eval’:
Documents/firstchess.c:312:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
     unsigned char             value_piece[6] = {VALUE_PAWN, VALUE_KNIGHT, VALUE_BISHOP, VALUE_ROOK, VALUE_QUEEN, VALUE_KING};
     ^
Documents/firstchess.c:312:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Documents/firstchess.c:312:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Documents/firstchess.c:312:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Documents/firstchess.c:312:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Documents/firstchess.c: In function ‘ComputerThink’:
Documents/firstchess.c:615:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
     score = Search(-MATE, MATE, max_depth, &mm3);
     ^
Documents/firstchess.c:615:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Documents/firstchess.c: In function ‘main’:
Documents/firstchess.c:696:9: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘char (*)[256]’ [-Wformat=]
         sscanf (buf, "%s", &s);
         ^
if you want to look at the code just download firstchess.c from the link I posted above.

Can't access that link from work.

Those warnings have nothing to do with <conio.h>

Topic archived. No new replies allowed.