Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I move a library inside a project's source tree and compiling static binaries?

I want to use a particular tool that utilizes ANCIENT binaries without upgrading it's API usage. This way I can use the old libraries inside the single binary without wrecking the local host environment. I am on nix with netbeans/eclipse/code::blocks.

I don't have a problem reading, just looking for a starting point. Any thoughts?

share|improve this question
up vote 2 down vote accepted

You could make a script to compile the lib and modify your project file to use that library's path. for qmake it would be :

DEPENDPATH += . oldlib/
INCLUDEPATH += . oldlib/
LIBS += -Wl,-rpath=oldlib-build-path-L. -L../ -Loldlib-build-path -loldlib

Note that the rpath part is strictly for gcc, could be different on different compilers.

share|improve this answer
i primarily use gcc and am looking into using this solution...if it works i'll give the check – RobotHumans Nov 29 '10 at 20:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.