I have a makefile which looks like this .
DEFINES=-std=c++0x
INCS_GTK=-I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/include/atk-1.0 -I/usr/include/cairo
Append -lYARP_OS -lYARP_sig -lYARP_math -lYARP_dev -lYARP_name -lYARP_init
to LDLIBS
.
Warning: the linking order may matter.
Also, be sure that the linker knows that /usr/local/lib
is a place where to look for libraries, otherwise instruct it with -L/usr/local/lib
(you could add another makefile variable, e.g. LIBPATHS
or something similar, to contain the libraries paths).
As a general synopsis, if you have a library libMyLib.a
in folder /my/path
, the gcc
(or g++
) can be invoked with the following parameters:
gcc -L/my/path -lMyLib [...]
-L
is used to include paths where the linker will look for libraries-l
is used to link a library, which must be passed without the lib
prefix and the extensionThis question may be useful for a general understanding of libraries usage in C and C++: How to use Libraries