Dear Friends,
I'm Ashok Kumar.P.S, a new member to this forum. i need one urgent help from u. I'm using Win2000 and i tried to create a client program for MySQL4.1 using VC++6. I had installed the MySQL using msi package(Windows Installer, Source distribution). when i'm trying to run the pgm it's giving some linker errors. i gave those errs here followed by the pgm.(There is no compilation errs).
And also i added the lib directory in the option menu( both the directories inside the lib(opt and debug)).
Is it necessary to use the MySQL binary distribution?
Code:
#include <my_global.h>
#include <my_sys.h>
#include <mysql.h>
static char *opt_host_name = NULL;
static char *opt_user_name = NULL;
static char *opt_password = NULL;
static unsigned int opt_port_num = 0;
static char *opt_socket_name = NULL;
static char *opt_db_name = NULL;
static unsigned int opt_flags = 0;
static MYSQL *conn;
int main (int argc, char *argv[])
{
conn = mysql_init (NULL);
if (conn == NULL)
{
fprintf (stderr, "mysql_init() failed (probably out of memory)\n");
exit (1);
}
if (mysql_real_connect (conn, opt_host_name, opt_user_name, opt_password, opt_db_name, opt_port_num, opt_socket_name, opt_flags) == NULL)
{
fprintf (stderr, "mysql_real_connect() failed\n");
mysql_close (conn);
exit (1);
}
mysql_close (conn);
exit (0);
}
The errs r:
userinfo.obj : error LINK2001 : unresolved external symbol _mysql_close@4
userinfo.obj : error LINK2001 : unresolved external symbol _mysql_real_connect@32
userinfo.obj : error LINK2001 : unresolved external symbol _mysql_init@4
userinfo.obj : error LINK2001 : unresolved external symbol _winmain@16
I don't know why its happening. pls give me some suggestions.
I'm waiting for ur replies.
Thanks and Regards,
Ashok Kumar.P.S