Bonjour,
je suis débutant, et nouveau sur le forum, en programmation, j'arrive a me debrouillé sur des programme simple type tutorial de quelque 10aines de lignes.
Je doit me plonger dans un code de pres de 1000 lignes que quelqu'un d'autrre a réaliser. j'obtient des erreurs :
les lignes de code corespondantes sont :P.c: In function 'get_net':
P.c:375: error: syntax error before 'TICK'
P.c: In function 'lcp_rx_handlers':
P.c:468: error: 'LWORD' undeclared (first use in this function)
P.c:468: error: (Each undeclared identifier is reported only once
P.c:468: error: for each function it appears in.)
P.c:468: error: syntax error before 'lw'
P.c:515: error: 'lw' undeclared (first use in this function)
P.c: In function 'ipcp_rx_handlers':
P.c:626: error: 'hostip' undeclared (first use in this function)
P.c:643: error: 'myip' undeclared (first use in this function)
P.c: In function 'do_ipcp_actionss':
P.c:739: error: 'myip' undeclared (first use in this function)
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 void lcp_rx_handlers(void) { BYTE opt, optlen, code; BYTE rejects=0; WORD auth=0; LWORD lw;=> P.c:468:error: 'LWORD' undeclared (first use in this function) ... if ((lcp_state&0xf) == PPP_OPENED && get_lword(&lw)) =>P.c:515: error: 'lw' undeclared (first use in this function) { // Get magic num lw.l++; // Return magic num + 1 put_lword(&lw); copy_rx_tx(net_rxin-rxout); // Echo the data send_ppp(PPP_ECHO_REP, ppp_rxid, 1); } // Others to state machine.. ... } ..... void ipcp_rx_handlers(void) { BYTE opt, optlen; BYTE rejects=0; ppp_pcol = PPP_IPCP; if (ppp_code == PPP_CFG_REQ) // IPCP config request? { // Check option list while (get_byte(&opt) && get_byte(&optlen) && optlen>=2) { if (opt==IPCP_OPT_ADDR && optlen==6)// IP address option? get_lword(&hostip); // (will be accepted) =>P.c:626: error: 'hostip' undeclared (first use in this function) else { put_byte(opt); // Skip other options put_byte(optlen); // (will be rejected) copy_rx_tx(optlen - 2); rejects++; } } .... else if (!hostip.l) // If null IP address { hostip.l = myip.l + 1; // ..give host my IP addr + 1 =>P.c:643: error: 'myip' undeclared (first use in this function) ipcp_event_handler(EVENT_RCR_ERR); // (for want of anthing else) if (ipcp_action & SCN) { // If OK to NAK, do so put_byte(IPCP_OPT_ADDR); put_byte(6); put_lword(&hostip); // ..with new address as hint send_ppp(PPP_CFG_NAK, ppp_rxid, 1); } ... } void do_ipcp_actionss(void) { // int hostip,myip; (ici c'est en commentaire car on m' a dit que un int n'est pas une structure, seulement lorsque je compile avec cette lignes sa marche...enfin d'autre erruer apparaissent..lol) ppp_pcol = PPP_IPCP; if (ipcp_action & SCR) // Send config request? { init_txbuff(0); setpos_txin(PPP_HEADLEN); put_byte(IPCP_OPT_ADDR); put_byte(6); put_lword(&myip); =>P.c:739: error: 'myip' undeclared (first use in this function) send_ppp(PPP_CFG_REQ, ++ppp_txid, 1); .... } }
voila mon pb, j'espere que cela n'est pas trop indigeste.
si qq1 peut me mettre sur la voix....;-)
je sais que ce n'est que des probleme de declaration, mais quand je declare les variables, j'ai d'autre erreurs, et on me dit que je declare mal mes variable sans m'en dire plus....
merci d'avance
Partager