I am trying to run this program listed below on a FeeBSD unix server it is giving a a this error message:
/usr/lib/crt1.o: In function _start':
/usr/lib/crt1.o(.text+0x69): undefined reference tomain'
Can anyone please help me that what's wrong with this i am new to both C and MySql !!
/ client1.c /
#include <stdio.h>
#include <mysql.h>
#define def_host_name NULL / host to connect to (default = localhost) /
#define def_user_name NULL / user name (default = your login name) /
#define def_password NULL / password (default = none) /
#define def_db_name NULL / database to use (default = none) /
MYSQL conn; / pointer to connection handler */
int main (int argc, char argv[])
{
conn = mysql_init (NULL);
mysql_real_connect (
conn, / pointer to connection handler /
def_host_name, / host to connect to /
def_user_name, / user name /
def_password, / password /
def_db_name, / database to use /
0, / port (use default) /
NULL, / socket (use default) /
0); / flags (none) */
mysql_close (conn);
exit (0);
}