Hi Andrew and Jonathan (cc: Ian and Matthias since they discussed this issue recently), Perhaps we should add a new entry to the FAQ at the wiki about this. We have seen a few questions already in gcc-help, and it seems it is going to be a frequent issue with the most recent major distros: http://gcc.gnu.org/ml/gcc-help/2011-11/msg00132.html https://lists.ubuntu.com/archives/ubuntu-devel/2010-November/031991.html https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition http://wiki.debian.org/ToolChain/DSOLinking#Onlylinkwithneededlibraries http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking I could add it myself, but I am not sure how to summarize the problem and, in particular, it doesn't seem to me that "just use --no-as-needed" is the correct answer. http://gcc.gnu.org/wiki/FAQ Cheers, Manuel. On -10/01/37 20:59, Carlo Pinciroli wrote: > Thank you very much Andrew, your suggestion indeed solved the problem. > And thanks also for your fast answer! :-) > > Cheers, > Carlo > > On Tue, Nov 15, 2011 at 6:49 PM, Andrew Pinski<pinskia@xxxxxxxxx> wrote: >> On Tue, Nov 15, 2011 at 9:34 AM, Carlo Pinciroli<ilpincy@xxxxxxxxx> wrote: >>> >>> Dear forum, >>> >>> I have a problem with linking of a program I have wrote. Instead of giving >>> you the entire program, which is pretty large, I have prepared a basic >>> example that you can find attached to this message. The example uses CMake >>> to compile. >>> >>> I have three files: >> >> Sounds like --as-needed is the default with the linker you are using. >> That is GCC is not the issue but rather the defaults with the distros >> you are using are different. >> >> Thanks, >> Andrew Pinski >> > > >