kyo_2000,你好,下面是代码和出错提示
我只是使用了Mysql的一个函数mysql_init,它提示mysql_com.h的
typedef struct st_net {
Vio* vio;
my_socket fd; //////////提示这行出错/////////////
int fcntl;
unsigned char *buff,*buff_end,*write_pos,*read_pos;
char last_error[MYSQL_ERRMSG_SIZE];
unsigned int last_errno,max_packet,timeout,pkt_nr;
unsigned char error;
my_bool return_errno,compress;
my_bool no_send_ok;
unsigned long remain_in_buf,length, buf_length, where_b;
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
} NET;
能不能帮我分析一下。
//--代码
#include <vcl.h>
#pragma hdrstop
#include "MainApp.h"
#include <mysql.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
MYSQL * m_pMyData =NULL;
int __fastcall TForm1::ConnectToDataBase(const char* svr, DWORD port)
{
strcpy(m_ipSvr, svr);
m_port = port;
m_pMyData = mysql_init((MYSQL*) 0);
return 0;
}
出错提示:
[C++ Error] mysql_com.h(115): E2303 Type name expected
[C++ Error] mysql_com.h(115): E2139 Declaration missing