Feb 23, 2011 at 5:15am UTC
This s my code..I am using dev c++ compiler....I got the following error...
[Linker error] undefined reference to `err_handler(void*, int, int, int, char const*, char const*)'
#include <windows.h>
#define IDC_STATIC -1
#define DBNTWIN32
#include <stdio.h>
#include <windows.h>
#include <sql.h>
#include <sqlfront.h>
#include <sqldb.h>
int err_handler(PDBPROCESS,INT,INT,INT,LPCSTR,LPCSTR);
int msg_handler(PDBPROCESS,DBINT,INT,INT,LPCSTR,LPCSTR,LPCSTR,DBUSMALLINT);
main()
{
PDBPROCESS dbproc; // The connection with SQL Server.
PLOGINREC login;
// The login information.
// DBCHAR name[100];
//DBCHAR city[100];
dberrhandle (err_handler);
dbmsghandle (msg_handler);
dbinit ();
login = dblogin ();
DBSETLUSER (login, "sa");
DBSETLPWD (login, "4516200");
DBSETLAPP (login, "FORD");
dbproc = dbopen (login, "PRABHAKARAN\\WINCC");
dbcmd (dbproc, "SELECT * FROM dbo.tbl_wamdata");
//dbcmd (dbproc, " WHERE state = 'CA' ");
dbsqlexec (dbproc);
dbexit();
//return (0);
}
Feb 24, 2011 at 12:23am UTC
You need to link against the library that offers you the function err_handler(). But we don't endorse the use of Dev-C++ as it's no longer supported. Try wxDevCpp instead.