| Author |
Message |
intmail01@gmail.com *nix forums beginner
Joined: 21 Nov 2005
Posts: 9
|
Posted: Thu Jul 13, 2006 10:03 am Post subject:
How to built in my application BDB static object file
|
|
|
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
|
Posted: Thu Jul 13, 2006 10:42 am Post subject:
Re: How to built in my application BDB static object file
|
|
|
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
|
|
| Back to top |
|
 |
intmail01@gmail.com *nix forums beginner
Joined: 21 Nov 2005
Posts: 9
|
Posted: Mon Jul 17, 2006 1:35 pm Post subject:
Re: How to built in my application BDB static object file
|
|
|
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
|
Posted: Wed Jul 19, 2006 12:51 pm Post subject:
Re: How to built in my application BDB static object file
|
|
|
It works now.
Thanks for all. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|