Problème compilation avec Dev C++

cs_AMokers Messages postés 83 Date d'inscription jeudi 18 juillet 2002 Statut Membre Dernière intervention 8 octobre 2008 - 30 juil. 2004 à 16:44
cs_AMokers Messages postés 83 Date d'inscription jeudi 18 juillet 2002 Statut Membre Dernière intervention 8 octobre 2008 - 31 juil. 2004 à 12:38
Bonjours,
Voila quand je compile mon programme, j'obtient ca :

Compilateur: Default compiler
Exécution de g++.exe...
g++.exe "C:\Dev-Cpp\Projets\Tetrinet\main.cpp" -o "C:\Dev-Cpp\Projets\Tetrinet\main.exe" -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:/Dev-Cpp/Projets/Tetrinet/main.cpp: In function `BOOL MainDlg(HWND__*,
unsigned int, unsigned int, long int)':
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:83: warning: passing NULL used for
non-pointer argument passing 3 of `LONG RegCreateKeyExA(HKEY__*, const
CHAR*, long unsigned int, CHAR*, long unsigned int, long unsigned int,
_SECURITY_ATTRIBUTES*, HKEY__**, DWORD*)'
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:83: warning: argument to non-pointer type
`long unsigned int' from NULL
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:83: warning: passing NULL used for
non-pointer argument passing 5 of `LONG RegCreateKeyExA(HKEY__*, const

CHAR*, long unsigned int, CHAR*, long unsigned int, long unsigned int,
_SECURITY_ATTRIBUTES*, HKEY__**, DWORD*)'
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:83: warning: argument to non-pointer type
`long unsigned int' from NULL
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:135: warning: comparison is always false
due to limited range of data type

C:/Dev-Cpp/Projets/Tetrinet/main.cpp:248: warning: passing NULL used for
non-pointer argument passing 3 of `LONG RegCreateKeyExA(HKEY__*, const
CHAR*, long unsigned int, CHAR*, long unsigned int, long unsigned int,
_SECURITY_ATTRIBUTES*, HKEY__**, DWORD*)'
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:248: warning: argument to non-pointer type
`long unsigned int' from NULL
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:248: warning: passing NULL used for

non-pointer argument passing 5 of `LONG RegCreateKeyExA(HKEY__*, const
CHAR*, long unsigned int, CHAR*, long unsigned int, long unsigned int,
_SECURITY_ATTRIBUTES*, HKEY__**, DWORD*)'
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:248: warning: argument to non-pointer type
`long unsigned int' from NULL
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:250: warning: passing NULL used for
non-pointer argument passing 3 of `LONG RegSetValueExA(HKEY__*, const CHAR*,
long unsigned int, long unsigned int, const BYTE*, long unsigned int)'
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:250: warning: argument to non-pointer type
`long unsigned int' from NULL
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:252: warning: passing NULL used for
non-pointer argument passing 3 of `LONG RegSetValueExA(HKEY__*, const CHAR*,
long unsigned int, long unsigned int, const BYTE*, long unsigned int)'
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:252: warning: argument to non-pointer type

`long unsigned int' from NULL
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:254: warning: passing NULL used for
non-pointer argument passing 3 of `LONG RegSetValueExA(HKEY__*, const CHAR*,
long unsigned int, long unsigned int, const BYTE*, long unsigned int)'
C:/Dev-Cpp/Projets/Tetrinet/main.cpp:254: warning: argument to non-pointer type
`long unsigned int' from NULL

C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x19):main.cpp: undefined reference to `WSAStartup@8'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x90):main.cpp: undefined reference to `DeleteObject@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0xba):main.cpp: undefined reference to `WSACleanup@0'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x1f1):main.cpp: undefined reference to `closesocket@4'

C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x202):main.cpp: undefined reference to `closesocket@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x213):main.cpp: undefined reference to `closesocket@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x23b):main.cpp: undefined reference to `htons@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x252):main.cpp: undefined reference to `socket@12'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x26f):main.cpp: undefined reference to `WSAAsyncSelect@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x284):main.cpp: undefined reference to `bind@12'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x297):main.cpp: undefined reference to `listen@8'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x4d4):main.cpp: undefined reference to `inet_addr@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x4f3):main.cpp: undefined reference to `gethostbyname@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x564):main.cpp: undefined reference to `htons@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x57b):main.cpp: undefined reference to `socket@12'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x598):main.cpp: undefined reference to `WSAAsyncSelect@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x5ad):main.cpp: undefined reference to `connect@12'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x5bd):main.cpp: undefined reference to `WSAGetLastError@0'

C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x600):main.cpp: undefined reference to `recv@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x665):main.cpp: undefined reference to `send@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x770):main.cpp: undefined reference to `send@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x786):main.cpp: undefined reference to `send@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x811):main.cpp: undefined reference to `send@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x827):main.cpp: undefined reference to `send@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x892):main.cpp: more undefined references to `send@16' follow
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x980):main.cpp: undefined reference to `closesocket@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x991):main.cpp: undefined reference to `closesocket@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0x9de):main.cpp: undefined reference to `accept@12'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0xa03):main.cpp: undefined reference to `recv@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0xab1):main.cpp: undefined reference to `send@16'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0xac4):main.cpp: undefined reference to `closesocket@4'
C:\DOCUME~1\VILLEG~1\LOCALS~1\Temp/cc0ubaaa.o(.text+0xad5):main.cpp: undefined reference to `closesocket@4'

Exécution terminée

Comment je peut faire svp ?

PS : Beaucoup d'application ne marchent pas, alors que je les ai télécharger sur ce site :(

Est-ce DevC++ qui est mal configuré, comment je peut faire ?

Merci

Merci de votre aide.

6 réponses

cs_AlexMAN Messages postés 1536 Date d'inscription samedi 21 décembre 2002 Statut Membre Dernière intervention 24 mai 2009 1
30 juil. 2004 à 17:01
il faut ke tu link ws2_32.lib ou wsock32.lib selon la version de winsock ke tu utilise (2 ou 1.1)

++
0
cs_AMokers Messages postés 83 Date d'inscription jeudi 18 juillet 2002 Statut Membre Dernière intervention 8 octobre 2008
30 juil. 2004 à 22:30
Merci, mais comment fait-on pour rajouter ?,
Et comment savoir quelle librairie rajouter ?

Sinon je pige pas j'inclue pourtant bien winsock.h :/

Est-on obligé de faire un projet ?

Quand on ne c'est pas quelle librairie rajouter, peut ton tous les inclure ?

Merci de votre aide.
0
cs_AlexMAN Messages postés 1536 Date d'inscription samedi 21 décembre 2002 Statut Membre Dernière intervention 24 mai 2009 1
30 juil. 2004 à 22:52
un header ne contient aucune fonction, simplement la declaration de fonctions presentes ds la lib.
Avec Devc++, je sais pas si ca marcherait, essaye ca :

#pragma comment(lib, "ws2_32.lib") //version 2
ou
#pragma comment(lib, "wsock32.lib") //version 1

sinon, il faudrait ke t'aille trifouiller ds les propriétés de linkage pour trouver komen linker une lib, car je ne conais pa trop dev c++.
Pour savoir kel version tu as utilisé, lorsk tu initialises winsock (WSAStartup je crois), si tu as fait :
MAKEWORD(1, 1) >> version 1
MAKEWORD(2, 0) >> version 2
SI tu n'as pas fait ca, tu as fait un truc du genre WSAStartup(0x202, ...); enfin a partir de mes infos, tu trouvera kel lib linker..

Voila, j'espere avoir été assez clair

++
0
cs_AMokers Messages postés 83 Date d'inscription jeudi 18 juillet 2002 Statut Membre Dernière intervention 8 octobre 2008
31 juil. 2004 à 00:56
Oui merci beaucoup, mais comment tu c'est le nom de la librairie ?

par exemple tu fais ton source, et tu as un msg d'erreur de link, comment tu c'est ce qu'il faut rajouter comme librairie ?

Merci de ton aide.

PS : tu aurais ICQ, ou msn stp ?

merci d'avance.
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_AlexMAN Messages postés 1536 Date d'inscription samedi 21 décembre 2002 Statut Membre Dernière intervention 24 mai 2009 1
31 juil. 2004 à 01:26
Je connais le nom de ces libs paske j'ai eu le mm pb avec winsock, mais jne pourrais pas te citer chak lib kan mm !
Dsl pas de msn ni de ICQ, pas bavard le alexman..

++
0
cs_AMokers Messages postés 83 Date d'inscription jeudi 18 juillet 2002 Statut Membre Dernière intervention 8 octobre 2008
31 juil. 2004 à 12:38
Merci pour tout ;)
0
Rejoignez-nous