【求助】用gtk连接mysql问题
<HR style="COLOR: #000000" SIZE=1><!-- / icon and title --><!-- message -->libmysqlclient15-dev
不知道为什么还会有libmysqlclient14-dev
或者更小的,感觉15的是最新的,因此就安装的这个~~~
这是我按照GTK+2.0编程范例(清华大学出版社)的那本书上打的:
gboolean my_connect ()
{
myconnect = mysql_init (myconnect);
if (mysql_real_connect (myconnect, "localhost", NULL,
NULL,NULL,MYSQL_PORT,NULL,0))
{
return TRUE;
}
else
{
myconnect = NULL;
return FALSE;
}
}
以下是make信息:
gcs@dubuntu:~/Projects/oldbbs$ make
gcc -o oldbbs oldbbs.c -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient `pkg-config gtk+-2.0 --cflags --libs `
In file included from oldbbs.c:26:
interface.h: 在函数 ‘my_connect’ 中:
interface.h:40: 错误: 实参数目与原型不符
/usr/include/mysql/mysql_com.h:348: 错误: 原型声明
make: *** [all] 错误 1
/usr/include/mysql/mysql_com.h:348 附近大概是这个样子的:
/*
The following function is not meant for normal usage
Currently it's used internally by manager.c
*/
struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
unsigned int timeout);
struct rand_struct {
unsigned long seed1,seed2,max_value;
double max_value_dbl;
};