If you made use of the configure scripts for your dependencies, you can
use pkg-config to generate compile and link flags needed to get to those
packages.
For example, to get my program to find the right include and linker
options for DirectFB on my pc I can compile with:
`pkg-config --cflags directfb` on the compiler command line.
When I run "pkg-config --cflags directfb" on the command line I see:
-D_REENTRANT -I/usr/include/directfb
Similarly, "pkg-config --libs directfb" shows:
-ldirectfb -lfusion -ldirect -lpthread
To find these options look for ".pc" files, usually in lib/pkgconfig.
These files should contain the information needed to compile and link
against the dependent package, along with some version info, etc. The
.pc files should be created as part of the configure process, and
additionally reflect some of the options provided to configure, for
example, --prefix, etc.
For example, my /usr/lib/pkgconfig/directfb.pc contains:
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include
Name: DirectFB
Description: Graphics and windowing library for the Linux frame buffer
device
Version: 1.2.7
Requires: fusion direct
Libs: -L${libdir} -ldirectfb -lpthread
Libs.private: -L${libdir} -ldl -lz
Cflags: -D_REENTRANT -I/usr/include/directfb
Niels Roest wrote:
Yes, you do miss libraries.
I still strongly suggest to use the supplied 'configure' method.
As a reference, this is my output:
first compiling:
gcc -DHAVE_CONFIG_H -I. -I.. -I.. -D_REENTRANT
-I/opt/local/include/directfb
-DEXAMPLESDATADIR=\"/opt/local/share/LiTE/examples\"
-DDIRECT_FORCE_DEBUG -Wall -O3 -pipe -g3 -fno-inline
-Werror-implicit-function-declaration -MT checktest.o -MD -MP -MF
.deps/checktest.Tpo -c -o checktest.o checktest.c
then linking:
gcc -Wall -O3 -pipe -g3 -fno-inline
-Werror-implicit-function-declaration -o .libs/lite_checktest
checktest.o -L/opt/local/lib ../leck/.libs/libleck.so
../lite/.libs/liblite.so /opt/local/lib/libdirectfb.so
/opt/local/lib/libfusion.so /opt/local/lib/libdirect.so -lpthread
-Wl,--rpath -Wl,/opt/local/lib
hth
Niels
Tu Duong Manh wrote:
Hi, i just used a script, the content is this.
gcc -c -o $1.o $1.c -D_REENTRANT -I
/export/scratch/opt/duonganh/LiTE-0.8.10/ -I
/export/scratch/codes_fs/usr/local/include/directfb/ -D_GNU_SOURCE
-Wall -O3 -pipe -Werror-implicit-function-declaration
gcc -D_REENTRANT -I /export/scratch/opt/duonganh/LiTE-0.8.10 -I
/export/scratch/codes_fs/usr/local/include/directfb -D_GNU_SOURCE
-Wall -O3 -pipe -Werror-implicit-function-declaration -o $1 $1.o
-L/export/scratch/usr/lib -ldirectfb -lz -lfusion -ldirect -lpthread
I start it with ./cl.sh check
greetings from dresden : )
Hi.
yup, you miss libraries.
Your compiler is not including these flags.
This should not happen if you follow the 'configure' system.
Either use 'configure'
or please explain exactly how you try to compile.
The error messages here are not so interesting...
greets
Niels
____________________________________________________________________
Psssst! Schon vom neuen WEB.DE MultiMessenger gehört? Der kann`s mit
allen: http://www.produkte.web.de/messenger/?did=3123
_______________________________________________
LiTE mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/lite