niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Berkeley DB
How to built in my application BDB static object file
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
Author Message
intmail01@gmail.com
*nix forums beginner


Joined: 21 Nov 2005
Posts: 9

PostPosted: Thu Jul 13, 2006 10:03 am    Post subject: How to built in my application BDB static object file Reply with quote

Hello,

I would like no know how to insert in my binary files the .SO file of
berkeley db library.
In fact I would like to build independant application without to
install these .so and related files.

When I launch my application on other machine, LINUX send me a message
something like library .so is needed. In this way my application is not
independant. I do not to show to any one that I use bdb as database
engine.

When compiling I use the command line like: gcc -lbdblibrary source.c
-o source.bin

Thank you.
Back to top
Michael Cahill
*nix forums Guru Wannabe


Joined: 26 May 2005
Posts: 219

PostPosted: Thu Jul 13, 2006 10:42 am    Post subject: Re: How to built in my application BDB static object file Reply with quote

Hi,

I think you're asking about static linking, so that no separate
Berkeley DB library is required when your application is run.

To link statically, make sure that you build Berkeley DB with a static
library (which is the default). Then link your application with:

gcc source.c -o source.bin libdb-4.4.a

You may also need dependent libraries such as the POSIX threads
library, depending on the platform:

gcc source.c -o source.bin libdb-4.4.a -lpthread

Regards,
Michael.
Back to top
Joseph Brun
*nix forums beginner


Joined: 29 Mar 2006
Posts: 9

PostPosted: Sat Jul 15, 2006 1:21 am    Post subject: Re: How to built in my application BDB static object file Reply with quote

intmail01@gmail.com wrote:

Quote:
I do not to show to any one that I use bdb as database
engine.

Depending on how your program is distributed, you might need to check
out the License.
http://www.sleepycat.com/docs/sleepycat/license_db.html
Back to top
intmail01@gmail.com
*nix forums beginner


Joined: 21 Nov 2005
Posts: 9

PostPosted: Mon Jul 17, 2006 1:35 pm    Post subject: Re: How to built in my application BDB static object file Reply with quote

I followed your recommandation but no change.
This is my command line that I typed:

gcc main.c /usr/local/lib/libdb-4.3.a -o main.out

This is the error that linux send me when launching the binary file on
different computer:

../main.out: error while loading shared libraries: libdb-4.3.so: cannot
open shared object file: No such file or directory

About the license I have no intention to distribute my application.

Thanks
Back to top
intmail01@gmail.com
*nix forums beginner


Joined: 21 Nov 2005
Posts: 9

PostPosted: Wed Jul 19, 2006 12:51 pm    Post subject: Re: How to built in my application BDB static object file Reply with quote

It works now.

Thanks for all.
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
The time now is Thu Dec 04, 2008 3:07 am | All times are GMT
navigation Forum index » Databases » Berkeley DB
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Running php file everyday on scheduled time sachin PHP 1 Fri Jul 21, 2006 12:49 pm
No new posts Regarding thesaurus iso file Srikanth modules 0 Fri Jul 21, 2006 10:42 am
No new posts how can i use fstream object to clear file's content? horneye C++ 2 Fri Jul 21, 2006 7:52 am
No new posts CORBA object used in Vector niks C++ 0 Fri Jul 21, 2006 7:45 am
No new posts how can i get a file descriptor not used? mars system 0 Fri Jul 21, 2006 7:41 am

Mobile Phones | Loans | Herbal Supplements | Overstock Coupons | Magazine Subscription
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2414s ][ Queries: 16 (0.1628s) ][ GZIP on - Debug on ]