LinuxSA Mailing list archives
Index:
[thread]
[date]
[subject]
[author]
[stats]
From: Andrew Pullin <andrew@hotspurbgc.com.au>
To : David Lloyd <lloy0076@rebel.net.au>
<linuxsa@linuxsa.org.au>
Date: Tue, 31 Jul 2001 14:00:26 +1000
Re: Compiling Berkeley DB Programs
Hi There,
Off the top of my head I cannot remember how to do it as
it was a while ago, but I ran into problems with make when I
tried to compile using lex and yacc from a Sun box with flex
and bison with linux. In my researches, I discovered how to
add other libraries in the make man page. From memory it is
something as simple as -l and the library, but I don't
remember exactly. RTFM and all will be revealed.
Cheers!
Andrew.
----- Original Message -----
From: David Lloyd <lloy0076@rebel.net.au>
To: <linuxsa@linuxsa.org.au>
Sent: Monday, July 30, 2001 3:15 PM
Subject: Compiling Berkeley DB Programs
>
> Hi There!
>
> I've got a full version of RedHat 7.1 installed.
>
> I'm trying to compile this:
>
> #include <stdio.h>
> #include <sys/types.h>
> #include <db.h>
>
> int main() {
> DB *dbp;
>
> int t_ret, ret;
>
> if ((ret=db_create(&dbp, NULL, 0) != 0)) {
> fprintf(stderr, "db_create: %s\n", db_strerror(ret));
> exit(1);
> }
>
> if ((ret=dbp->open(dbp, "vote", "vote.db", DB_RECNO,
DB_CREATE, 0664)
> != 0)) {
> dbp->err(dbp, ret, "vote.db");
> goto err;
> }
>
> err:
> if ((t_ret=dbp->close(dbp, 0) != 0) && (ret == 0)) {
> ret=t_ret;
> }
>
> exit(ret);
> }
>
> But I get:
>
> [lloy0076@localhost voting]$ make
> gcc -o vote -O2 -march=athlon -L /lib -l lib/libdb-3.1.so
vote.o
> gcc: lib/libdb-3.1.so: No such file or directory
> make: *** [vote] Error 1
>
> I've tried /usr/lib and various other combinations.
>
> I can't quite work out what to use, sleepycat's home page
doesn't have
> it on the FAQ, I have the New Riders Berkeley DB Book but
it doesn't
> tell you how to LINK with the actual library and I can't
find any
> information on the Internet specific to my problem.
>
> What flags do I need (I suspect it's a combination of -I
and -l with
> various locations/files) to link against DB3.1?
>
> DSL
>
> --
> LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on
irc.linux.org.au
> To unsubscribe from the LinuxSA list:
> mail linuxsa-request@linuxsa.org.au with "unsubscribe"
as the subject
--
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject
Index:
[thread]
[date]
[subject]
[author]
[stats]
Return to the LinuxSA Mailing List Information Page