if (!MYSQLSUCCESS(rc))
{
SQLFreeEnv(henv);
SQLFreeConnect(hdbc);
// error_out();
exit(-1);
}
}
the error on compilation is :
Undefined first referenced
symbol in file
SQLConnect /var/tmp/ccnGf8ud.o
SQLAllocEnv /var/tmp/ccnGf8ud.o
SQLFreeEnv /var/tmp/ccnGf8ud.o
SQLAllocStmt /var/tmp/ccnGf8ud.o
SQLAllocConnect /var/tmp/ccnGf8ud.o
SQLFreeConnect /var/tmp/ccnGf8ud.o
ld: fatal: Symbol referencing errors. No output written to d
collect2: ld returned 1 exit status
i just want to know that what libraries u need to compile the database program
because i think i am working on older version of solaris so i dont have sql.h and sqlext.h header files also, but i downloaded those files form the net
somebody told me that i should use -lsql while compiling
like
g++ <filename.cpp> -lsql
i serached it in all the possible directories of my system but i couldnt get it
1)so i am unable to understand which files u need to include and what libraries u need when u want a database to be connected to c++.
2) if the libraries of database r not in the system then from where we can download it
These function calls look like ODBC calls so I'm assuming you're trying to use unixODBC. If not, you're gonna need it because Microsoft ODBC hasn't been ported to unix yet, and isn't likely to be anytime this millenium
They have a faq entry relating to this very problem. In short you need to link with -lodbc .
Right, this isn't windows. You won't get those functions without some sort of third-party library, which I assumed you had but apparently not. See that library I linked you to? unixODBC? Get it.