Click to See Complete Forum and Search --> : c++


sundari
May 8th, 1999, 05:41 AM
Hi ..

I am facing this problem. I would be grateful to those who could help me in this regard.
Should I include any dll or lib files to access DBLIB routines ??
I have Visual Studio ver 6.0 & win 95 in my machine.
Please find the source code & the error I am facing pasted below .
Thanks again ...
Sundari ..


*********** source code ************************
#include <iostream.h>
#include <windows.h>


#define INITGUID
#ifndef DBNTWIN32
#define DBNTWIN32

#include <SQL.h>
#include <SQLEXT.h>
#endif /* DBNTWIN32 */

#include "sqlfront.h"
#include "sqldb.h"

int main()
{
char strlogin[10], strPassword[10];

cout<<endl<<"enter ur login";
cin>>strlogin;
cout<<endl<<"type the password";
cin>>strPassword;
// DBPROCESS *dbproc;
LOGINREC *login;
dbinit ();
login = dblogin();
if(login==NULL)
{
cout<<endl<<"error";
}
return 0;
}
********************************************

****** Error *****************************
--------------------Configuration: sql - Win32 Debug--------------------
Linking...
sql.obj : error LNK2001: unresolved external symbol _dblogin
sql.obj : error LNK2001: unresolved external symbol _dbinit
Debug/sql.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

sql.exe - 3 error(s), 0 warning(s)
********************************************

davidramsey
May 8th, 1999, 11:33 AM
When your project is compiled it uses the header files to check the syntax of your function calls. Once it goes to link it needs the code i.e. a library or external source file. If you are trying to build the project with a dynamic configuration you will still need the library to link the project with. In this case the linker will put pointers to the dll that it needs at runtime.

Hope this helps


TKE Dave