[maemo-developers] Undefined reference error

From: David King davidk at openismus.com
Date: Fri May 14 11:23:58 EEST 2010
On 2010-05-13 22:32, Pallavi Kandhare <pallavi.kandhare at yahoo.com> wrote:
>Hi,
>I have 2 files : list1.h and list1.c, and I call some functions defined in list1.h in main function of main.c.
>list1.h is included in both list1.c and main.c.
>Still i am getting the following error :
>/test1file/src/main.c undefined reference to function-name
> 
>The list1.o file is not created. What changes do i need to make to my Makefile in order to remove this error.

It might be easier to use a build system that automatically creates 
Makefiles for you, like autotools (more specifically, automake for 
Makefiles):

http://wiki.maemo.org/Packaging#Autotools
http://www.openismus.com/documents/linux/automake/automake

Then you can simply define all the sources for each target, and let the 
build system track the dependencies for preprocessing, compiling and 
linking.

-- 
David King | http://amigadave.com/ | davidk at openismus.com
More information about the maemo-developers mailing list