Google Answers Logo
View Question
 
Q: Compiling C++ Programs - Making a single object file without .so dependencies ( No Answer,   3 Comments )
Question  
Subject: Compiling C++ Programs - Making a single object file without .so dependencies
Category: Computers > Programming
Asked by: biologyandeconomics-ga
List Price: $2.00
Posted: 10 Oct 2002 13:12 PDT
Expires: 09 Nov 2002 12:12 PST
Question ID: 74964
I have shared object libraries, *.so, from a third party.
I can compile my program by linking to those libraries, and
as long as those libraries are in a location included in my
LD_LIBRARY_PATH environment variable, everything works fine.
I would like to compile their .so's and my code into a single
new .so that has no dependencies - a single shared object
that I can distribute without having to distribute ancillary
.so files.

What options do I need to pass to g++ / gcc in order to do this?

Request for Question Clarification by maniac-ga on 10 Oct 2002 17:04 PDT
Hello Biologyandeconomics,

I cannot make a suggestion for what you asked for. I could suggest
 - a way to group the .so files and change the install script to
handle your objects and those of the third party.
 - a way to extract the objects from an archive (.a) and build a new
shared object library if the files were compiled as position
independent.

Would you like an answer based on one of those solutions?
  --Maniac
Answer  
There is no answer at this time.

Comments  
Subject: Re: Compiling C++ Programs - Making a single object file without .so dependencies
From: tne-ga on 10 Oct 2002 14:08 PDT
 
Once you have linked the static libs you have no more dependencies.

Your executable will run without them.


I am cofused what you want ??
Subject: Re: Compiling C++ Programs - Making a single object file without .so dependencie
From: biologyandeconomics-ga on 11 Oct 2002 13:56 PDT
 
like g++ -static?
Subject: Re: Compiling C++ Programs - Making a single object file without .so dependencies
From: mdupont777-ga on 30 Oct 2002 02:32 PST
 
This could be made as an interesting extension to the linker :
a. Take a bunch of shared libs and merge them into one.
b. Take a shared lib and make it static again.


Do you have the source code for these libs? Can you rebuild them.

What is this worth to you, 2$ is a bit little for development work.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy