[Freeswitch-dev] Using extern variable - undefined reference while loading module

Steven Ayre steveayre at gmail.com
Tue Apr 24 16:25:59 UTC 2018

What does your makefile look like? Are you linking against libfreeswitch?

The sample makefile might be worth a look:

On 19 April 2018 at 10:34, Vidhya S R <vidhyasr23 at gmail.com> wrote:

> Hi,
> I'm using an extern variable (switch_hash_t *) declared in a header file
> under src/include. This variable is defined in another .c file under src.
> Now, I'm including this header file in my module under src/mod/my_mod and
> trying to initialise the hash. It compiles fine but when freeswitch is run,
> the module is not loaded and throws the error undefined reference.
> Im not sure why. Sorry if this is a basic question.
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20180424/82eada7b/attachment.html>

More information about the FreeSWITCH-dev mailing list