Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi ,

I want to write a sybase program client program that send query to sybase database and come with results

<pre lang="xml">
#include <sybfront.h>
#include <iostream>
#include <sybdb.h>
#include <syberror.h>
int main()
{
DBPROCESS *dbproc; /* The connection with */
/* SQL Server */
LOGINREC *login; /* The login information */
DBCHAR name[40];
DBCHAR city[20];
RETCODE return_code;


/* Initialize DB-Library */
dbinit();
login = dblogin();
DBSETLPWD(login, "server_password");
DBSETLAPP(login, "example");
dbproc = dbopen(login, NULL);
dbcmd(dbproc, "select au_lname, city from pubs2..authors");
dbcmd(dbproc, " where state = ?CA? ");
dbsqlexec(dbproc);
while ((return_code = dbresults(dbproc)) !=NO_MORE_RESULTS )
{
if (return_code == SUCCEED)
{
dbbind(dbproc, 1, STRINGBIND, (DBINT)0, (unsigned char*)name);
dbbind(dbproc, 2, STRINGBIND, (DBINT)0, (unsigned char*)city);

while (dbnextrow(dbproc) != NO_MORE_ROWS)
{
printf ("%s: %s\n", name, city);
}
}
}
/* Close the connection to SQL Server */
dbexit();
return 0;
}



Here I am getting the below error:

Undefined first referenced
symbol in file
dbcmd client.o
dbnextrow client.o
dbbind client.o
dbexit client.o
dbinit client.o
dbopen client.o
dbresults client.o
dbsqlexec client.o
dblogin client.o
dbsetlname client.o
ld: fatal: Symbol referencing errors. No output written to a.out

Can anyone tell how to remove this error
Posted
Updated 5-Jun-11 23:52pm
v2
Comments
Richard MacCutchan 2-Jun-11 6:09am    
Well go ahead and write it; you don't need our permission.
Chandrasekharan P 2-Jun-11 6:34am    
What have you done so far??
Sandeep Mewara 2-Jun-11 10:42am    
Any effort?
Sergey Alexandrovich Kryukov 2-Jun-11 14:18pm    
So what? This is not a question.
--SA

1 solution

Are you using the correct libraries .so files to link with? It seems that you are not specifying Sybase libraries path to your linker.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900