[Asterisk-Dev] Question about compiling a module for Asterisk with CPP stuff

Sergey Kuznetsov asterisk_biz at deeptown.org
Fri Feb 4 09:31:25 MST 2005


_Znaj is a mangled name. TO solve this issue, Leo must put declaration 
at the beginning of file:

extern "C" {

int load_module(void);
int unload_module(void);
char *description(void);
int usecount(void);
char *key(void);
}

In this case gcc will know that is a C convention must be used.
The rest of the code may be done in C++.





creslin at digium.com wrote:

>On Fri, Feb 04, 2005 at 02:07:53AM +0100, Leo Moll wrote:
>  
>
>>Hi Everybody!
>>
>>I'm writing an extension module for my asterisk but I have a problem 
>>that I can't figure out. The compilation of the project makes no 
>>problem, the .so file is created correctly but the module is not loaded 
>>by the Asterisk.
>>
>>In the log file I got the following error:
>>
>>Feb  4 01:36:39 WARNING[13395]: 
>>/usr/lib/asterisk/modules/app_say_pattern.so: undefined symbol: _Znaj
>>Feb  4 01:36:39 WARNING[13395]: Loading module app_say_pattern.so failed!
>>    
>>
>
>IIRC, C++ uses different symbol style than C.  You'll need to do an 
>
>extern "C" {
>}
>
>guard block on your API interaction functions.
>
>Hrm.. now that I look back on your problem though, that may not be your
>problem...
>
>It looks like it can't find something called _Znaj... Are you sure that
>you linked in the file that has the _Znaj symbol in it?
>
>Matthew Fredrickson
>_______________________________________________
>Asterisk-Dev mailing list
>Asterisk-Dev at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-dev
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>  
>


-- 
All the Best!
Sergey.
=========================
Sergey Kuznetsov
President/CEO
         High Intellectual Technologies, Inc.

           Web: http://www.hitcalls.com
        E-mail: sergey.kuznetsov at highintellect.com
Business phone: (416) 548-9700
  Mobile phone: (647) 287-8448

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20050204/529e5db6/attachment.htm


More information about the asterisk-dev mailing list