Penguin
Annotated edit history of CNotes version 9, including all changes. View license author blame.
Rev Author # Line
9 AristotlePagaltzis 1 InNeedOfRefactor
2
1 BenStaz 3 !Where can I set paths to the directories my shared libraries are stored in?
4
5 The list of directories to be searched is stored in the file ''/etc/ld.so.conf''.
6 Simply append your desired directory to this file.
7
8 *echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf
3 BenStaz 9
10 Now run ''ldconfig -v''
6 LawrenceDoliveiro 11
12 __Note:__ Don't do this for [Gentoo]. That already has <tt>/usr/local/lib</tt> included, and in any case <tt>/etc/ld.so.conf</tt> is automatically generated from the files in <tt>/etc/env.d</tt>, so any customizations you want must be made in the latter.
3 BenStaz 13
5 IanMcDonald 14 Note : [ldconfig(8)] must be run whenever a DLL is added, when a DLL is removed, or when the set of DLL directories changes
2 BenStaz 15
16 !Which libraries is my system aware of?
17
18 *ldconfig -Nv
3 BenStaz 19
4 BenStaz 20 !!Environment Variables
21
22 !LD_LIBRARY_PATH
3 BenStaz 23
24 A colon-separated set of directories where libraries should be searched for first, before the standard set of directories.
25
26 *export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/new/dir/to/add"
4 BenStaz 27
28 !LDLIBS
29
30 Contains a list of external libraries to link with.
31
32 For example to link with the libtrace library and the math library:
33 *export LDLIBS="-ltrace -lm"
7 BenStaz 34
35 !How to define macros inside the gcc command.
36
37 gcc -D<macro_name>=<definition>
38
39 Note : The ''=<definition>'' part is optional.
40
41 For example:
42
8 BenStaz 43 *gcc -DEVENT_DEBUG=1
5 IanMcDonald 44 ----
45 See also SharedLibraryNotes