voici mon code (c'est un othello):
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
 
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
main() {
    void screeng(void);
    int coordx(void);
    int coordy(void);
    void ppion(int, int);
    void mode_raw(int);
    screeng();
    int i=1, j=1;
    while(i>0 && j>0 && i<9 && j<9) {
        mode_raw(1);
        i=coordx();
        j=coordy();
        mode_raw(0);
        if(i>0 && j>0 && i<9 && j<9) {ppion(i,j);}
    }
    system("clear");    
}
void ppion(int i, int j) {
    int x, y;
    x=(j*4);
    y=(i*2)+1;
    printf ("\033[%u;%uH", y, x);
    printf ("***");
}
int coordx(void) {
    printf ("\033[%u;%uH", 20, 1);
    printf("entrez un coord ('A'..'H') : ");
    char c;
    int i=0;
    c=getchar();
    if(c=='A' || c=='a') {i=1;}
    if(c=='B' || c=='b') {i=2;}
    if(c=='C' || c=='c') {i=3;}
    if(c=='D' || c=='d') {i=4;}
    if(c=='E' || c=='e') {i=5;}
    if(c=='F' || c=='f') {i=6;}
    if(c=='G' || c=='g') {i=7;}
    if(c=='H' || c=='h') {i=8;}
    return i; 
}
int coordy(void) {
    printf ("\033[%u;%uH", 21, 1);
    printf("entrez un coord (1..8) : ");
    char c;
    int i=0;
    c=getchar();
    if(c=='1') {i=1;}
    if(c=='2') {i=2;}
    if(c=='3') {i=3;}
    if(c=='4') {i=4;}
    if(c=='5') {i=5;}
    if(c=='6') {i=6;}
    if(c=='7') {i=7;}
    if(c=='8') {i=8;}
    return i; 
}
void screeng(void) {
    system("clear");
    printf("    1   2   3   4   5   6   7   8    \n");
    printf("  +---+---+---+---+---+---+---+---+  \n");
    printf("A |   |   |   |   |   |   |   |   | A\n");
    printf("  +---+---+---+---+---+---+---+---+  \n");
    printf("B |   |   |   |   |   |   |   |   | B\n");
    printf("  +---+---+---+---+---+---+---+---+  \n");
    printf("C |   |   |   |   |   |   |   |   | C\n");
    printf("  +---+---+---+---+---+---+---+---+  \n");
    printf("D |   |   |   |   |   |   |   |   | D\n");
    printf("  +---+---+---+---+---+---+---+---+  \n");
    printf("E |   |   |   |   |   |   |   |   | E\n");
    printf("  +---+---+---+---+---+---+---+---+  \n");
    printf("F |   |   |   |   |   |   |   |   | F\n");
    printf("  +---+---+---+---+---+---+---+---+  \n");
    printf("G |   |   |   |   |   |   |   |   | G\n");
    printf("  +---+---+---+---+---+---+---+---+  \n");
    printf("H |   |   |   |   |   |   |   |   | H\n");
    printf("  +---+---+---+---+---+---+---+---+  \n");
    printf("    1   2   3   4   5   6   7   8    \n");
}
void mode_raw(int activer) {
    static struct termios cooked;
    static int raw_actif = 0;
    if (raw_actif == activer) {return;}
    if (activer) {
        struct termios raw;
        tcgetattr(STDIN_FILENO, &cooked);
        raw = cooked;
        cfmakeraw(&raw);
        tcsetattr(STDIN_FILENO, TCSANOW, &raw);
   }
   else {tcsetattr(STDIN_FILENO, TCSANOW, &cooked);}
   raw_actif = activer;
}
sur solaris avec gcc :
[ovandere@sunset ovandere]$ gcc othelloC.c
Undefined first referenced
symbol in file
cfmakeraw /var/tmp//cc9HKoBN.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
pouvez vous m'aider à comprendre ce qu'il ne va sur solaris?