how to tell linker from which place library mentioned by -l should be taken from
Jump to turn (10)
- 1how to tell linker from which place library mentioned by -l should be taken from
- 2how to check is symbol is present in the dynamic library
- 3what's the output of linux dm
- 4explain output of dm -D
- 5nm -D /path/to/library.so | grep “myfunction”
- 6nm -D /path/to/library.so | grep “myfunction” whats T and whats D in output
- 7how to check what are the functions and objects in linux shared librtary
- 8how to demangle nm output
- 9std::cxx11:basicstring vs std::basicstring
- 10linker function redefinition
- User
how to tell linker from which place library mentioned by -l should be taken from
- Assistant
In order to specify the directory from which the linker should take the library mentioned by the
-lflag, you can use the-Lflag followed by the directory path.For example, if you have a library named
myliband it is located in the directory/path/to/mylibrary, you can specify the directory with the-Lflag like this:codegcc -L/path/to/mylibrary -lmylib program.c -o programThis tells the linker to search for the library
mylibin the directory/path/to/mylibrarywhen linking the program. - User