This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: function not found in extras.o
- From: Bart Veer <bartv at ecoscentric dot com>
- To: kross at elands dot co dot nz
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Tue, 29 Mar 2005 10:15:01 +0100 (BST)
- Subject: Re: [ECOS] function not found in extras.o
- References: <200503290440.j2T4erJ2099918@atmail.net24.net.nz>
>>>>> "Keith" == kross@elands co nz <kross@elands.co.nz> writes:
Keith> We have created a library and built it using ecos-config.
Keith> I get the error below to a simplified main.c
Keith>
Keith> As you can see extras.o contians the wanted function.
Keith>
Keith> How do I get my app to talk to my driver?
Keith>
Keith> any ideas to try.
The problem is probably C vs. C++ linkage. You are compiling main
with arm-elf-g++, so the compiler treats it as C++ code. In your
header file you are defining modem_wait_incoming_call() as an extern
rather than extern "C" (or by using the eCos externC macro), so the
compiler will assume that function has C++ linkage. Presumably the
implementation of the function is in C code so has C linkage.
Either use arm-elf-gcc to compile main.c, or prototype the modem
function with externC, or preferably both.
Bart
--
Bart Veer eCos Configuration Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss