Probleme mit MySQL Headerdateien mysql_com.h



  • Hallo zusammen

    Ich hab ein Beispielprogramm abgeschrieben und bekome beim kompilieren folgenden Fehler.

    [C++ Error] mysql_com.h(116): E2303 Type name expected
    [C++ Error] mysql_com.h(116): E2139 Declaration missing ;
    Beziehend auf:

    typedef struct st_net {
      Vio* vio;
      unsigned char *buff,*buff_end,*write_pos,*read_pos;
      my_socket fd;	                                       /*<-------- 116*/
      unsigned long max_packet,max_packet_size;
      unsigned int last_errno,pkt_nr,compress_pkt_nr;
      unsigned int write_timeout, read_timeout, retry_count;
      int fcntl;
      char last_error[MYSQL_ERRMSG_SIZE];
      unsigned char error;
      my_bool return_errno,compress;
      /*
        The following variable is set if we are doing several queries in one
        command ( as in LOAD TABLE ... FROM MASTER ),
        and do not want to confuse the client with OK at the wrong time
      */
      unsigned long remain_in_buf,length, buf_length, where_b;
      unsigned int *return_status;
      unsigned char reading_or_writing;
      char save_char;
      my_bool no_send_ok;
      gptr query_cache_query;
    } NET;
    

    [C++ Error] mysql_com.h(180): E2147 'SOCKET' cannot start a parameter declaration
    Bezieht sich auf:

    int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
    	       unsigned int timeout);
    

    Bedeutet das jetzt, dass die Headerdatei fehlerhaft ist?
    Weil in meinem abgeschriebenen Source kommt der Befehl my_socket nicht vor.

    Vielleicht hat schon jemand mal Probleme damit gehabt

    Edit:
    Bitte die Code-Tags benutzen. Danke!



  • Bevor Du mysql.h includest must Du

    #include <winsock.h>
    

    machen.



  • thaks for this answer 🙂


Anmelden zum Antworten