LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-05-2004, 03:07 AM   #1
chuanyung
LQ Newbie
 
Registered: Jan 2004
Posts: 25

Rep: Reputation: 15
"Tinycdb 0.74" link error?


Dear all,

Does anyone have experience on tinycdb?
After I download it, and make install. It's all ok.
But I try to write a simple code to test it,
I get "undefined reference cdb_make_start,cdb_make_add and cdb_make_finish".
I check the library directory (usr/local/lib) and library file (libcdb.a),
and they are ok.
What's wrong?
Thanks for your help.

Here is my command line:
g++ -o test test.cpp -I/usr/local/include -L/usr/local/lib -lcdb

my test.cpp:
----------------------------------------------------------------------------
#include "cdb.h"
#include <cstdio>
//#include <unistd.h>
#include <fcntl.h>
#include <cstring>
using namespace std;

int main(int argc,char* argv[])
{
struct cdb_make cdbm;
int fd;
char *key="Hello";
char *val="world";
unsigned klen=strlen(key);
unsigned vlen=strlen(val);
fd = open(argv[1], O_RDWR|O_CREAT);
cdb_make_start(&cdbm, fd); /* initialize structure */
cdb_make_add(&cdbm, key, klen, val, vlen);
cdb_make_finish(&cdbm);
return 0;
}
------------------------------------------------------------------------

Regards,
cylin.

Last edited by chuanyung; 10-05-2004 at 03:09 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"creating symbolic link" "operation not permitted" wheni Linux - Newbie 3 05-08-2011 01:36 AM
"mythtv-setup" giving "Session management error: Authentication Rejected" Mitchua Ubuntu 0 10-09-2005 04:32 PM
FC4 install errors, "diabling IRQ #10" "nobody cares" error message??? A6Quattro Fedora 6 07-20-2005 12:49 PM
make error "libtool: link: cannot find the library `' " jdolluc Linux - Software 2 10-15-2003 09:51 PM
LFS 4.1: Stalled at Perl, "missing seperator" error from "make" SparceMatrix Linux From Scratch 1 06-07-2003 03:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration