dbTalk Databases Forums  

How to built in my application BDB static object file

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss How to built in my application BDB static object file in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default How to built in my application BDB static object file - 07-13-2006 , 06:03 AM






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.


Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: How to built in my application BDB static object file - 07-13-2006 , 06:42 AM






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.


Reply With Quote
  #3  
Old   
Joseph Bruni
 
Posts: n/a

Default Re: How to built in my application BDB static object file - 07-14-2006 , 09:21 PM




intmail01 (AT) gmail (DOT) 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





Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: How to built in my application BDB static object file - 07-17-2006 , 09:35 AM



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


Reply With Quote
  #5  
Old   
AT
 
Posts: n/a

Default Re: How to built in my application BDB static object file - 07-19-2006 , 08:51 AM



It works now.

Thanks for all.


Reply With Quote
Reply




Thread Tools
Display Modes

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

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.