Ver Mensaje Individual
  #10 (permalink)  
Antiguo 17/06/2014, 14:10
vosk
 
Fecha de Ingreso: agosto-2012
Mensajes: 601
Antigüedad: 11 años, 8 meses
Puntos: 83
Respuesta: problema al compilar c+mysql en windows

Bueno un ultimo intento, la cabecera windows.h ya incluye winsock.h y winsock2.h:

Código C:
Ver original
  1. #if defined(Win32_Winsock)
  2. #warning "The  Win32_Winsock macro name is deprecated.\
  3.     Please use __USE_W32_SOCKETS instead"
  4. #ifndef __USE_W32_SOCKETS
  5. #define __USE_W32_SOCKETS
  6. #endif
  7. #endif
  8. #if defined(__USE_W32_SOCKETS) || !(defined(__CYGWIN__) || defined(__MSYS__) || defined(_UWIN))
  9. #if (_WIN32_WINNT >= 0x0400)
  10. #include <winsock2.h>
  11. /*
  12.  * MS likes to include mswsock.h here as well,
  13.  * but that can cause undefined symbols if
  14.  * winsock2.h is included before windows.h
  15.  */
  16. #else
  17. #include <winsock.h>
  18. #endif /*  (_WIN32_WINNT >= 0x0400) */
  19. #endif

Si ya se que esto no aporta nada, pero implica que primero debes incluir winsock.h o winsock2.h y luego windows.h (en este orden). A ver si de esta forma al menos te compila sin errores. Por cierto, si incluyes winsock debes linkar con libwsock32 y si incluyes winsock2 debes linkar libws2_32

Luego está lo del servicio: asegurate que al menos puedes conectarte desde el monitor cliente mysql.exe. A mi me funciona en windows 7(64) contra MySQL 5.0.51 compilado con el mingw que viene con el code::blocks

A ver si hay suerte, siento no ser de mas ayuda

Saludos
vosk