I use gcc to compile the program that I need to associate with the C library with a non-standard name; it is called stuff.a instead of libstuff.a .
I canโt change the file name (permission problems).
I don't want to include the full library (i.e. using gcc program.c stuff.a -oprogram )
I want to compile as gcc program.c -L/path/to/library/ -lstuff -oprogram , but gcc will not find the library (because it is not called libstuff.a ).
I am working on a Linux box.
How can I execute a (dynamic) link?
EDIT:
Thanks to everyone, and my apologies for the poorly worded question.
I didnโt even have a common object (I thought I could dynamically link the * .a file), so this confused many of you. Again, apologies for my ignorance.
What I ended up with was creating a shared object in the local directory by adding it to my LD_LIBRARY_PATH environment variable and linking again.
It works like a charm (from 1.3M executable to 5.8K).
Thanks again.
c gcc linker
Escualo
source share