请问如下解决这个问题?
已经把inclue和lib在vc的option里设置好了
但是在编译的时候出现如下错误信息
--------------------Configuration: connect_mysql - Win32 Debug--------------------
Compiling...
connect_mysql.cpp
F:\STUDIO\VC\CONSOLE\connect_mysql\connect_mysql.cpp(56) : error C2664: 'mysql_init' : cannot convert parameter 1 from 'struct st_mysql ** ' to 'struct st_mysql *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.connect_mysql.exe - 1 error(s), 0 warning(s)代码如下:
#include "stdafx.h"
#include "iostream.h"
#include "winsock.h"
#include <mysql.h>
int main(int argc, char* argv[])
{
MYSQL *conn;
conn=mysql_init(&conn);
return 0;
}
已经把inclue和lib在vc的option里设置好了
但是在编译的时候出现如下错误信息
--------------------Configuration: connect_mysql - Win32 Debug--------------------
Compiling...
connect_mysql.cpp
F:\STUDIO\VC\CONSOLE\connect_mysql\connect_mysql.cpp(56) : error C2664: 'mysql_init' : cannot convert parameter 1 from 'struct st_mysql ** ' to 'struct st_mysql *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.connect_mysql.exe - 1 error(s), 0 warning(s)代码如下:
#include "stdafx.h"
#include "iostream.h"
#include "winsock.h"
#include <mysql.h>
int main(int argc, char* argv[])
{
MYSQL *conn;
conn=mysql_init(&conn);
return 0;
}
仍然通不过,错误信息如下
E:\studio\vc\bb\bb.cpp(13) : warning C4700: local variable 'conn' used without having been initialized
Linking...
bb.obj : error LNK2001: unresolved external symbol _mysql_init@4
Debug/bb.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.bb.exe - 2 error(s), 1 warning(s)