On 2010-05-14 01:54, Pallavi Kandhare <pallavi.kandh...@yahoo.com> wrote:
Hi David,
My problem with that project is solved. I included .c files in Makefile.am
It is good to hear that! I sent this reply to the mailing list also, so
that the discussion can be followed there.
Now i have a new project with only 1 .c file ie. main.c
Now, when i include third party libraries (hal/libhal.h and
hal/libhal-storage.h) in my main.c i again get the same error as :
/src/main.c undefined reference to function-name
For using libhal and libhal-storage is anything more to be added?
Yes, if you are using libhal and libhal-storage through pkg-config with
autotools, then I guess that you have:
PKG_CHECK_MODULES([HAL], [libhal libhal-storage])
or similar in your configure.ac. If not, then you should add it. If you
wish to use that library in your program (main.c in your case), then in
your Makefile.am you probably have something like:
bin_PROGRAMS = my_program
my_program_SOURCES = src/main.c
You need to add:
my_program_CPPFLAGS = $(HAL_CFLAGS)
my_program_LDADD = $(HAL_LIBS)
The first line adds the correct preprocessor flags, found by
pkg-config, so that the preprocessor can find the libhal and
libhal-storage headers. The LDADD line adds the correct linker flags so
that the linker can find the libhal and libhal-storage libraries, which
should solve the undefined reference error that you have.
http://www.openismus.com/documents/linux/using_libraries/using_libraries
The above link explains in slightly more detail what I have briefly
described.
Pls note: I had a look at the links u specified which also contains
configure.ac and Makefile.am
But my ESbox already creates them for me.
You might be able to do the steps that I have described above
automatically from within ESBox. Maybe someone who is more familiar
with it could comment?
--
David King | http://amigadave.com/ | dav...@openismus.com
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers