includes and binary code

soraberri 421246 at posta.unizar.es
Fri Dec 17 18:24:53 UTC 2004


I think my problem is a concept failure:
When I include in my programs a #include <afile.h> I am telling the 
compiler to look for afile.h and paste the code in my program. So far so 
good. But the header file usually only holds definitions and not the 
implementation of the functions, so what I don't understand is how can 
the system (compiler) know where and how to find the library or the 
piece of binary code that actually implements the functions defined in 
the afile.h

All this comes because trying to compile some application I get the 
following errors:
/home/soraberri/Desarrollo/estudioC/estudio_l2test/src/estudio_l2test.c:231: 
undefined reference to `strtoba'
estudio_l2test.o(.text+0x680):/home/soraberri/Desarrollo/estudioC/estudio_l2test/src/estudio_l2test.c:231: 
undefined reference to `baswap'
/home/soraberri/Desarrollo/estudioC/estudio_l2test/src/estudio_l2test.c:337: 
undefined reference to `baswap'
estudio_l2test.o(.text+0xb54):/home/soraberri/Desarrollo/estudioC/estudio_l2test/src/estudio_l2test.c:338: 
undefined reference to `batostr'
/home/soraberri/Desarrollo/estudioC/estudio_l2test/src/estudio_l2test.c:652: 
undefined reference to `hci_devba'
estudio_l2test.o(.text+0x14df):/home/soraberri/Desarrollo/estudioC/estudio_l2test/src/estudio_l2test.c:654: 
undefined reference to `str2ba'

All this functions are actually defined in 
/usr/include/bluetooth/bluetooth.h
and in the program I try to compile there is this line:
#include <bluetooth/bluetooth.h>


I hope this is a very simple question for you

regards




More information about the fedora-list mailing list