Re: Issues with LD when using GCC in a C program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marcus Clyne <eugaia@xxxxxxxxx> writes:

> // compile the shared object
>
> execl ("/usr/bin/gcc",
>           "-shared",
>           "-lmylib",
>           "-o",
>           so_file,
>           object_file,
>           NULL);

Note that -lmylib is in the wrong place.  Libraries must follow the
objects which refer to them.

It does not make sense that you would get an undefined symbol error when
using -shared, so I don't know what is going on.  It is unlikely that
you are missing anything from the environment.

I recommend adding the -v option to your execl, to verify that the
expected options are being passed to the subprocesses.  Compare to the
output using -v on the command line.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux