I'm using gentoo linux and I have a program in C++, built with
autotools, that links to log4cpp and glpk. However, when I move the
binary if I don't have this libraries there the binary won't run since
the linking was done dinamically. How can I do static linking?
Cheers,
Paulo Matos
Found the -static flag... Hope it does the trick! :)
> Cheers,
>
> Paulo Matos
> Found the -static flag... Hope it does the trick! :)
This is *the* wrong way to solve this problem.
Your binary may crash and/or not work correctly when moved to a
different machine.
See this thread for gory details:
http://groups.google.com/group/comp.os.linux.development.apps/browse_frm/thread/f664f8f7c19a4a7b
Correct way to ensure that you don't depend on dynamic versions of
log4cpp and glpk, while still making your binary portable to other systems:
g++ ... -o myapp mayapp.o ... -Wl,-Bstatic -llog4cpp -lglpk -Wl,-Bdynamic
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.