Skip to content
Snippets Groups Projects
Commit 15b2c1cc authored by Mathieu Peybernes's avatar Mathieu Peybernes
Browse files

Modify serial slides

parent 4550f7d8
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,8 @@
\item The advantage of static libraries is that the resulting executable file contains, before execution, everything that is necessary for it to work
\item On the other hand, a program compiled with a static library has an executable file that is much larger than the same program compiled with a dynamic library, since the definition of the library's functions is not in the executable file
\item Finally, if a static library is updated, any program that uses it will have to be recompiled so that it can take into account the modification. In the case of a dynamic library, this update does not need to be recompiled.
\item If both static and shared libraries are found, the linker gives preference to linking with the shared library unless the -static option is used.
\item To mix static and shared libraries gcc foo.c -Wl,-Bstatic -lbar -lbaz -lqux -Wl,-Bdynamic -lcorge -o foo.exe
\end{itemize}
}
......@@ -91,13 +93,13 @@
When using shared librairies at runtime we need to set \cmd{LD LIBRARY PATH} so the system knows where to find the library
\begin{itemize}
\item This variable tells the program where to look for dynamic libraries; if this location is changed, it is enough to modify the variable, without changing the program
\item To tell the system to look in the directory \cmd{path/to/the/library}, the variable \cmd{LD_LIBRARY_PATH} must be initialized as follows:
\item To tell the system to look in the directory \cmd{/path/to/the/library}, the variable \cmd{LD_LIBRARY_PATH} must be initialized as follows:
\begin{consoleoutput}
$ export LD_LIBRARY_PATH=/usr/local/lib
$ export LD_LIBRARY_PATH=/path/to/the/library
\end{consoleoutput}
\item In practice, you will never define this variable but you will add files to its definition:
\begin{consoleoutput}
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/users/profs/habibi/libs
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/the/library
\end{consoleoutput}
\end{itemize}
\end{frame}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment