Probléme linker avec MVS2005

Résolu
windowsfashion Messages postés 55 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 juin 2007 - 11 juil. 2006 à 22:41
windowsfashion Messages postés 55 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 juin 2007 - 12 juil. 2006 à 13:06
Bonsoir,

Depuis plusieurs heures j'essaye de compiler une source utilisant winsock2.h avec Microsoft Visual Studio 2005.
Mais à la fin de la compilation le compilo me reporte les erreurs suivantes:

SYNGENERATE.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
SYNGENERATE.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
SYNGENERATE.obj : error LNK2001: unresolved external symbol __imp__sendto@24
SYNGENERATE.obj : error LNK2001: unresolved external symbol __imp__setsockopt@20
SYNGENERATE.obj : error LNK2001: unresolved external symbol __imp__htons@4
SYNGENERATE.obj : error LNK2001: unresolved external symbol __imp__WSASocketW@24
SYNGENERATE.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
SYNGENERATE.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8

J'ai beau chercher je ne trouve pas
J'ai oublier d'inclure quelque chose? Ou ?

En attente d'une réponse, merci

++

4 réponses

BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
11 juil. 2006 à 22:53
#include <winsock2.h>
#include <windows.h>
#pragma comment(lib, "ws2_32.lib")

ciao...
BruNews, MVP VC++
3
windowsfashion Messages postés 55 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 juin 2007
11 juil. 2006 à 23:03
Ah je l'avai oublié cui la ^^
 
Merci beaucoup pour ton aide
0
cs_Urgo Messages postés 780 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 16 avril 2009 1
12 juil. 2006 à 03:16
#include <windows.h> pas nécessaire, déjà inclus dans #include <winsock2.h>

Urgo
0
windowsfashion Messages postés 55 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 juin 2007
12 juil. 2006 à 13:06
Je crois que c'est winsock 1.1 qui est inclus dans windows.h
0
Rejoignez-nous