在编译中产生
mysql_com.h(115) : error C2146: syntax error : missing ';' before identifier 'fd'
\include\mysql_com.h(115) : error C2501: 'SOCKET' : missing storage-class or type specifiers
\include\mysql_com.h(115) : error C2501: 'fd' : missing storage-class or type specifiers
Error executing cl.exe.在stdAFX.h中包含的头文件有:
#include "windows.h"
#include "stdlib.h"
#include "mysql.h"
#include "malloc.h"请各位帮忙。

解决方案 »

  1.   

    使用AfxOleInit()来初始化COM库了么?
    重载函数中完成:
    BOOL CADOTest1App::InitInstance()
      {
      AfxOleInit();
      ...... 
    }stdafx.h中加入如下语句:(stdafx.h这个文件哪里可以找到?你可以在FileView中的Header Files里找到)
    #import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF","adoEOF")
      

  2.   

    对不起,我的问题没有叙述清楚!我用VC6新建了一个win32 application项目,我没有使用mfc类。我只是包含了mysql.h头文件在stdafx.h,一下的程序中我没有使用任何mysql给的api,我已经在link选项卡中加入了libmysql.lib,并且将libmysql.dll拷贝到system32目录下。请各位大虾指点一二。十分感谢!
      

  3.   

    SOCKET 没有定义。你需要 include winsock.h
      

  4.   

    问题得到解决,谢谢 RodgerLiang(老狼) 和 crazyyu(大头) 两位大虾!另外,还想请教一个问题。为什么mysql给的例程没有用到winsock.h也可以编译通过呢?呵呵,这个问题另外给分 50