<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='color:#1F497D'>Sorry, I figured it out by
myself. It was because my code file is mod_mymodule.cpp. I changed it to
mod_mymodule.c and the module loaded file. So I take it as FS accepts only C
library but not C++ ?<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>Regards<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>Alex To<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Alex To
[mailto:tonhudung@gmail.com] <br>
<b>Sent:</b> Sunday, November 01, 2009 7:35 PM<br>
<b>To:</b> 'freeswitch-dev@lists.freeswitch.org'<br>
<b>Subject:</b> Visual Studio 2008 Pro SP1: switch_loadable_module.c:871 Error Loading
module .... **dll sym error [127l]<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Hi, excuse me if this is already asked where else but I did
browse through the mailing list and I couldn&#8217;t find anything related. I tried
to create a new end point module by copying the mod_skel to mod/endpoints/my_module
folder. <o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I modified &#8220;skel&#8221; to my module name and basically I leave no
codes in the load function, just a few lines to test if the new module is
working. These few lines are:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='text-indent:.5in;text-autospace:none'><span
style='font-size:10.0pt;font-family:"Courier New"'>*module_interface =
switch_loadable_module_create_module_interface(pool, modname);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
modem_endpoint_interface = <u>(switch_endpoint_interface_t*)</u>switch_loadable_module_create_interface(*module_interface,
SWITCH_ENDPOINT_INTERFACE);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
modem_endpoint_interface-&gt;interface_name = <span style='color:#A31515'>&quot;modem&quot;</span>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, <span
style='color:#A31515'>&quot;Hello World!\n&quot;</span>);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:green'>//<o:p></o:p></span></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:green'>//do_config(SWITCH_FALSE);<o:p></o:p></span></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:green'>//<o:p></o:p></span></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SWITCH_ADD_API(api_interface, <span style='color:#A31515'>&quot;modem&quot;</span>,
<span style='color:#A31515'>&quot;Modem API&quot;</span>, modem_function, <span
style='color:#A31515'>&quot;syntax&quot;</span>);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:green'>/* indicate that the module should continue to be loaded */<o:p></o:p></span></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style='color:blue'>return</span> SWITCH_STATUS_SUCCESS;</span><o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>It compiles but the module can&#8217;t load properly. I received
the following error:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='text-indent:.5in'>2009-11-01 19:18:10.551180 [CRIT]
switch_loadable_module.c:871 Error Loading module
D:\Projects\freeswitch\Debug\mod\mod_mymodule.dll<o:p></o:p></p>

<p class=MsoNormal style='text-indent:.5in'>**dll sym error [127l]<o:p></o:p></p>

<p class=MsoNormal style='text-indent:.5in'>**<o:p></o:p></p>

<p class=MsoNormal>I tried to load module normally at the FS console but &#8220;load
mod_skel&#8221; and &#8220;load mod_mymodule&#8221; gives the same error.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Would someone tell me what do I miss here. <o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Btw, I looked at mod_sofia and mod_iax, this line of code could
compile in those 2 modules.<o:p></o:p></p>

<p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-indent:.5in'><span style='font-size:10.0pt;
font-family:"Courier New"'>modem_endpoint_interface =
switch_loadable_module_create_interface(*module_interface,
SWITCH_ENDPOINT_INTERFACE);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal>The same line of code couldn&#8217;t compile in my module coz VS
complains: cannot convert from void* to switch_endpoint_interface_t*. I know
C++ require more type-safe conversion than C but anyone got the same error?<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>And how would I search in the mailing list ? Sorry for this
dumb question but I can&#8217;t seem to find out how to search in the archives. For
now, before posting anything, I need to try to browse through all the postings
first, which is <o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>quite tedious to do.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Regards<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Alex To<o:p></o:p></p>

</div>

</body>

</html>