[Freeswitch-dev] FW: Visual Studio 2008 Pro SP1: switch_loadable_module.c:871 Error Loading module .... **dll sym error [127l]
Alex To
tonhudung at gmail.com
Mon Nov 2 22:21:43 PST 2009
Hi, I copied mod_opal to mod_mymodule which is C++ module and remove all the
codes. I copied mod_skel.c to my module and rename it to .cpp. Compiled fine
in VS 2008 SP1 but
still I couldn't load the module in FS. The FS console still complains "dll
sym error.". If I rename mod_mymodule.cpp to .c, it loaded successfully.
Hmm, what do I miss here ? any special trick to load a C++ module in FS ?
Alex
-----Original Message-----
From: freeswitch-dev-bounces at lists.freeswitch.org
[mailto:freeswitch-dev-bounces at lists.freeswitch.org] On Behalf Of Giovanni
Maruzzelli
Sent: Sunday, November 01, 2009 9:05 PM
To: freeswitch-dev at lists.freeswitch.org
Subject: Re: [Freeswitch-dev] FW: Visual Studio 2008 Pro SP1:
switch_loadable_module.c:871 Error Loading module .... **dll sym error
[127l]
On Sun, Nov 1, 2009 at 12:44 PM, Alex To <tonhudung at gmail.com> wrote:
> 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++ ?
Ciao Alex,
no, you're on the wrong track. FS loads CPP modules.
Your problems probably come because mod_skel is a C module, and the
Makefile for it manages it as a C module.
If you want to compile a CPP module, find one as an example, and
adjust yourmodule and its Makefile to be compiled in a similar way.
I've done it, and I can assure it works.
In this moment I cannot tell you out of my memory which module is CPP,
but just browse the sources looking for *.cc or *.cpp.
-giovanni
>
>
>
> Regards
>
>
>
> Alex To
>
>
>
> From: Alex To [mailto:tonhudung at gmail.com]
> Sent: Sunday, November 01, 2009 7:35 PM
> To: 'freeswitch-dev at lists.freeswitch.org'
> Subject: Visual Studio 2008 Pro SP1: switch_loadable_module.c:871 Error
> Loading module .... **dll sym error [127l]
>
>
>
> Hi, excuse me if this is already asked where else but I did browse through
> the mailing list and I couldnt find anything related. I tried to create a
> new end point module by copying the mod_skel to mod/endpoints/my_module
> folder.
>
>
>
> I modified skel 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:
>
>
>
> *module_interface = switch_loadable_module_create_module_interface(pool,
> modname);
>
> modem_endpoint_interface =
>
(switch_endpoint_interface_t*)switch_loadable_module_create_interface(*modul
e_interface,
> SWITCH_ENDPOINT_INTERFACE);
>
> modem_endpoint_interface->interface_name = "modem";
>
> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hello
> World!\n");
>
> //
>
> //do_config(SWITCH_FALSE);
>
> //
>
> SWITCH_ADD_API(api_interface, "modem", "Modem API", modem_function,
> "syntax");
>
>
>
> /* indicate that the module should continue to be loaded */
>
> return SWITCH_STATUS_SUCCESS;
>
>
>
> It compiles but the module cant load properly. I received the following
> error:
>
>
>
> 2009-11-01 19:18:10.551180 [CRIT] switch_loadable_module.c:871 Error
Loading
> module D:\Projects\freeswitch\Debug\mod\mod_mymodule.dll
>
> **dll sym error [127l]
>
> **
>
> I tried to load module normally at the FS console but load mod_skel and
> load mod_mymodule gives the same error.
>
>
>
> Would someone tell me what do I miss here.
>
>
>
> Btw, I looked at mod_sofia and mod_iax, this line of code could compile in
> those 2 modules.
>
>
>
> modem_endpoint_interface =
> switch_loadable_module_create_interface(*module_interface,
> SWITCH_ENDPOINT_INTERFACE);
>
>
>
> The same line of code couldnt 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?
>
>
>
> And how would I search in the mailing list ? Sorry for this dumb question
> but I cant 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
>
>
>
> quite tedious to do.
>
>
>
> Regards
>
>
>
> Alex To
>
> _______________________________________________
> 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
>
>
--
Sincerely,
Giovanni Maruzzelli
Cell : +39-347-2665618
_______________________________________________
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
More information about the FreeSWITCH-dev
mailing list