This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: function not found in extras.o


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]