Hi fadden,

Thanks.
The library which i am using has exteral "C" linkage definition incorrect in
some of the header files.

Regards,
Sreedhar



On Tue, Apr 21, 2009 at 8:19 PM, sreedhar b <sreedhar...@gmail.com> wrote:

> Hi fadden,
>
> my "libmyusecase" is having  *.c files and all my header files is with the
> C linkage as below.
>
> #ifdef _cplusplus
> extern "C" {
> #endif /* _cplusplus */
> ...............................
> ...............................
>
> #ifdef _cplusplus
> }
> #endif /* _cplusplus */
>
> And i am trying to call the API's part of these *.c in a package containing
> *.cpp files. I get undefined reference error.
>
> But when i make the *.c files of "libmyusecase" to *.cpp  and remove the C
> linkage  in the header files i dont get the undefined reference error.
>
> Thanks and Regards,
> Sreedhar
>
> On Mon, Apr 20, 2009 at 10:53 PM, fadden <fad...@android.com> wrote:
>
>>
>> On Apr 20, 4:56 am, sreedhar b <sreedhar...@gmail.com> wrote:
>> > I have a use-case library having *.cpp files. And i made an application
>> with
>> > *.c extension. I included the above said library as a shared library
>> part of
>> > the Android.mk for building the application.
>> >
>> > I am getting errors showing undefined reference to API's of use-case
>> library
>> > that i used part of the application.
>>
>> My first thought would be a name-mangling issue.  Are you missing an
>> 'extern "C"' on the prototypes in your header file?
>>
>> % cat > foo.c
>> int test(int value) { return 3; }
>> % gcc -c foo.c
>> % nm foo.o
>> 00000000 T test
>> % mv foo.c foo.cpp
>> % gcc -c foo.cpp
>> % nm foo.o
>> 00000000 T _Z4testi
>>         U __gxx_personality_v0
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to