This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: undefined references in libc_nonshared.a when linking .so


chris cross <xcross_ibm@yahoo.com> writes:

> Trying to link a shared object on FC3 and get some
> confusing undefined references in libc_nonshared.a. I
> isolated it to when I pass -shared as a linker option,
> as in "gcc -Wl,-shared". When I use the gcc option,
> "gcc -shared" I don't get the problem. 

You should use gcc -shared.  You should not use gcc -Wl,-shared.

gcc -shared passes the right files and options to the linker to create
a shared library, including -shared.  Using -Wl,-shared just passes
-shared to the linker, without the required additional files.

There is no bug here.  Passing commands directly to the linker
requires that you know what you are doing.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]