error

Aug 27, 2014 at 6:23pm
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>
Aug 27, 2014 at 6:25pm
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 Aug 27, 2014 at 6:36pm
Aug 27, 2014 at 6:25pm
That is because conio is non-standard and is not supported by all compilers.
Aug 27, 2014 at 7:19pm
Yep, but I want to get that program to work. Thx
Aug 27, 2014 at 7:29pm
Then either get a new different compiler or use a standard library.
Last edited on Aug 27, 2014 at 7:30pm
Aug 28, 2014 at 3:42pm
Use a standard library?

How?
Aug 28, 2014 at 3:58pm
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>.
Aug 28, 2014 at 4:50pm
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/
Aug 28, 2014 at 5:27pm
If you haven't written the code, then why do you need the <conio.h> header?
Aug 28, 2014 at 5:55pm
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 Aug 28, 2014 at 5:56pm
Aug 28, 2014 at 6:07pm
> I don`t need it
then don't include it.
Aug 28, 2014 at 6:22pm
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);
         ^
Aug 28, 2014 at 6:52pm
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.