PDA

Voir la version complète : [ALLEGRO] conflit [SOCKET]


monnier.an
14/07/2008, 16h24
Voila je vient tout juste d'initialiser la socket sur Wondows avec DevCpp et j'obtient le log d'erreur suivant il semblerai que le type BITMAP soit défini a la fois dans Allegro et dans Socket. Je suis perdu que dois-je faire ?

De plus je n'aimerai pas recommencer tout mon travail de deux semaines.


Compilateur: Default compiler
Building Makefile: "C:\Documents and Settings\Antoine\Mes documents\C++\MyProj\allegro\RPG\Makefile.win"
Exécution de make clean
rm -f client.o RPG_private.res RPG.exe

gcc.exe -c client.c -o client.o -I"C:/Dev-Cpp/include"

In file included from C:/Dev-Cpp/include/windows.h:52,
from C:/Dev-Cpp/include/winsock2.h:22,
from socket_portable.h:2,
from client.c:8:

C:/Dev-Cpp/include/wingdi.h:1222: error: conflicting types for 'BITMAP'
C:/Dev-Cpp/include/allegro/gfx.h:276: error: previous declaration of 'BITMAP' was here

In file included from client.c:13:
affichage.h: In function `init_video':

affichage.h:50: warning: assignment from incompatible pointer type
affichage.h:51: warning: assignment from incompatible pointer type
affichage.h:52: warning: assignment from incompatible pointer type
affichage.h:58: warning: assignment from incompatible pointer type

affichage.h:59: warning: assignment from incompatible pointer type
affichage.h:65: warning: assignment from incompatible pointer type
affichage.h: In function `prepare_drawing':
affichage.h:110: warning: passing arg 1 of `acquire_bitmap' from incompatible pointer type
affichage.h: In function `buffer_onto_screen':
affichage.h:118: warning: passing arg 1 of `release_bitmap' from incompatible pointer type
affichage.h:125: warning: passing arg 1 of `request_video_bitmap' from incompatible pointer type
affichage.h:128: warning: passing arg 1 of `show_video_bitmap' from incompatible pointer type
affichage.h:130: warning: passing arg 1 of `blit' from incompatible pointer type

affichage.h: In function `deinit':
affichage.h:159: warning: passing arg 1 of `destroy_bitmap' from incompatible pointer type

affichage.h:160: warning: passing arg 1 of `destroy_bitmap' from incompatible pointer type
affichage.h:161: warning: passing arg 1 of `destroy_bitmap' from incompatible pointer type
affichage.h:162: warning: passing arg 1 of `destroy_bitmap' from incompatible pointer type
In file included from client.c:15:
affichage_plateau.h: In function `affichage_plateau':
affichage_plateau.h:17: warning: passing arg 1 of `draw_sprite' from incompatible pointer type
affichage_plateau.h:17: warning: passing arg 2 of `draw_sprite' from incompatible pointer type
affichage_plateau.h:21: warning: passing arg 1 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:21: warning: passing arg 2 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h: In function `affichage_joueur':
affichage_plateau.h:33: error: structure has no member named `w'
affichage_plateau.h:34: error: structure has no member named `h'
affichage_plateau.h:35: warning: assignment from incompatible pointer type
affichage_plateau.h:36: warning: passing arg 1 of `blit' from incompatible pointer type
affichage_plateau.h:36: warning: passing arg 2 of `blit' from incompatible pointer type
affichage_plateau.h:40: warning: passing arg 1 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:40: warning: passing arg 2 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:43: warning: passing arg 1 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:43: warning: passing arg 2 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:46: warning: passing arg 1 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:46: warning: passing arg 2 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:49: warning: passing arg 1 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:49: warning: passing arg 2 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:52: warning: passing arg 1 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:52: warning: passing arg 2 of `draw_trans_sprite' from incompatible pointer type
affichage_plateau.h:56: warning: passing arg 1 of `destroy_bitmap' from incompatible pointer type
In file included from client.c:17:
chargement_map.h: In function `charge':
chargement_map.h:26: warning: assignment from incompatible pointer type
chargement_map.h:48: warning: assignment from incompatible pointer type
chargement_map.h:49: warning: passing arg 1 of `clear_bitmap' from incompatible pointer type
chargement_map.h:51: warning: passing arg 1 of `blit' from incompatible pointer type
chargement_map.h:51: warning: passing arg 2 of `blit' from incompatible pointer type
chargement_map.h:59: warning: passing arg 1 of `destroy_bitmap' from incompatible pointer type
chargement_map.h: In function `charge_joueur':
chargement_map.h:80: warning: assignment from incompatible pointer type
chargement_map.h: In function `free_tableau':
chargement_map.h:103: warning: passing arg 1 of `destroy_bitmap' from incompatible pointer type
client.c: In function `_mangled_main':
client.c:109: warning: passing arg 1 of `clear_bitmap' from incompatible pointer type
client.c:129: warning: passing arg 1 of `destroy_bitmap' from incompatible pointer type

make.exe: *** [client.o] Error 1

Exécution terminée

monnier.an
15/07/2008, 00h11
Bon je me répond tout seul car j'ai trouver la solution finalement mais je poste pour d'autre personne qui pourai avoir le même problème

il suffit de mettre:

#include <allegro.h>
#include <winalleg.h>
#include <winsock2.h>

et voila le tour est joué!