Externally compiled modules must declare AST_MODULE_SELF_SYM

So i made a minor change in my module (i rolled it back and no change with the error) and at the time i tried to compile, i’ve got this error i haven’t got for a little bit more than a month.
Here the top of my file, AST_MODULE_SELF_SYM() is defined so why the error ?

You haven’t actually stated what the error is or what you are seeing.

error: #error “Externally compiled modules must declare AST_MODULE_SELF_SYM.”
#error “Externally compiled modules must declare AST_MODULE_SELF_SYM.”

You’d like want to do something like:

#define AST_MODULE_SELF_SYM __internal_my_module_self

okay it works, thank you !
But could you explain why it works now ?

The header files define everything like functions and forward declarations, and AST_MODULE_SELF_SYM is used as a unique name to construct their names. You never actually defined AST_MODULE_SELF_SYM before.

I don’t understand what __internal_my_module_self is for…

It’s used to define a function[1] that can be used to get information of the module[2]. For modules in Asterisk it is automatically generated and taken care of. For external modules you have to define the name. As long as you define the name using the define I gave you before there is nothing else to do in regards to it.

[1] https://github.com/asterisk/asterisk/blob/master/include/asterisk/module.h#L501
[2] https://github.com/asterisk/asterisk/blob/master/include/asterisk/module.h#L337

1 Like

This thread isn’t asking end user questions. Although there are developers on the forum, most aren’t, and even though I did development in the past, I never needed to develop a completely new module let alone alone one which could be compiled to be version independent.

There are mailing lists and IRC channels for people actually developing C source code for Asterisk.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.