• News
  • Idefisk
  • Tools
  • Tutorials
  • Forum
  • Reviews
  • VoIP Providers
  • Archives
  • Gallery
ZOIPER SIP softphone
AsteriskGuru Archives
Mailing List Archives
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[asterisk-dev] undefined symbol: PQsetdbLogin

 
   AsteriskGuru Archives Forum Index -> Asterisk-Dev
View previous topic :: View next topic  
Author Message
abalashov at evaristesys.
Guest





PostPosted: Fri May 22, 2009 3:20 am    Post subject: [asterisk-dev] undefined symbol: PQsetdbLogin

You need to link against libpq when you link the asterisk binary (the
gcc -o / ld stage), e.g. -lpq.

Joel Jn-Francois wrote:

Quote:
Hi

I have created an asterisk module in c called app_callingcard.c. In my
app, I am connecting to a postgresql database using #include
<libpq-fe.h> library. I have been using this app in version 1.4 for
couple years now without any problems.

I recently upgraded to asterisk version 1.6.1 and have made the
necessary changes to my app so that its compatible with version 1.6.1.
I am able to compile my app in version 1.6.1 with no error messages and
it creates an app_callingcard.so file in asterisk's module folder.

The problem arises when I try to load my app within asterisk "module
load app_callingcard.so". I get the following error message:
WARNING[31732]: loader.c:417 load_dynamic_module: Error loading module
'app_callingcard.so': /usr/lib/asterisk/modules/app_
callingcard.so: undefined symbol: PQsetdbLogin.

How could that be when PQsetdbLogin is part of libpq-fe.h and asterisk
is able to compile it without any problems, but is not able to load it
using loader.c?

Thanks very much for your help

Joel


------------------------------------------------------------------------

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev


--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
Back to top
tilghman at mail.jeffandt
Guest





PostPosted: Fri May 22, 2009 5:34 am    Post subject: [asterisk-dev] undefined symbol: PQsetdbLogin

On Thursday 21 May 2009 23:07:47 Alex Balashov wrote:
Quote:
Joel Jn-Francois wrote:
> The problem arises when I try to load my app within asterisk "module
> load app_callingcard.so". I get the following error message:
> WARNING[31732]: loader.c:417 load_dynamic_module: Error loading module
> 'app_callingcard.so': /usr/lib/asterisk/modules/app_
> callingcard.so: undefined symbol: PQsetdbLogin.

You need to link against libpq when you link the asterisk binary (the
gcc -o / ld stage), e.g. -lpq.

And the way to do this is to place the following comment within your C source
file:

/*** MODULEINFO
<depend>pgsql</depend>
***/

--
Tilghman

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
Back to top
voirtech at gmail.com
Guest





PostPosted: Fri May 22, 2009 2:17 pm    Post subject: [asterisk-dev] undefined symbol: PQsetdbLogin

Quote:
> You need to link against libpq when you link the asterisk binary (the
>> gcc -o / ld stage), e.g. -lpq.

>>


Quote:
And the way to do this is to place the following comment within your C source
> file:

>
Quote:
/*** MODULEINFO
  <depend>pgsql</depend>
> ***/



Thanks everyone for your help.  I did add the following to my code, but I am still getting the exact error message.  I also made sure I deleted my old module and made sure the new module that was created is the one with  <depend>pgsql</depend>.

/*** MODULEINFO
   <depend>pgsql</depend>
 ***/

Is there something else that I am doing wrong?

Thanks
Joel


On Fri, May 22, 2009 at 2:18 AM, Tilghman Lesher <tilghman@mail.jeffandtilghman.com (tilghman@mail.jeffandtilghman.com)> wrote:
Quote:

On Thursday 21 May 2009 23:07:47 Alex Balashov wrote:
> Joel Jn-Francois wrote:
> > The problem arises when I try to load my app within asterisk "module
> > load app_callingcard.so". I get the following error message:
> > WARNING[31732]: loader.c:417 load_dynamic_module: Error loading module
> > 'app_callingcard.so': /usr/lib/asterisk/modules/app_
> > callingcard.so: undefined symbol: PQsetdbLogin.
>

Quote:
You need to link against libpq when you link the asterisk binary (the
> gcc -o / ld stage), e.g. -lpq.



And the way to do this is to place the following comment within your C source
file:

/*** MODULEINFO
   <depend>pgsql</depend>
 ***/

--
Tilghman


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev


Back to top
tzafrir.cohen at xorcom.c
Guest





PostPosted: Fri May 22, 2009 11:22 pm    Post subject: [asterisk-dev] undefined symbol: PQsetdbLogin

On Fri, May 22, 2009 at 11:06:55AM -0400, Joel Jn-Francois wrote:
Quote:
>> You need to link against libpq when you link the asterisk binary (the
>> gcc -o / ld stage), e.g. -lpq.
>>

> And the way to do this is to place the following comment within your C
source
> file:
>
>/*** MODULEINFO
> <depend>pgsql</depend>
> ***/


Thanks everyone for your help. I did add the following to my code, but I am
still getting the exact error message. I also made sure I deleted my old
module and made sure the new module that was created is the one with
<depend>pgsql</depend>.

/*** MODULEINFO
<depend>pgsql</depend>
***/

Is there something else that I am doing wrong?

Do you build your module in the Asterisk tree or outside of it? The
MODULEINFO section is used by the Asterisk build system when you build a
module in the tree.

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen@xorcom.com
+972-50-7952406 mailto:tzafrir.cohen@xorcom.com
http://www.xorcom.com iax:guest@local.xorcom.com/tzafrir

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
Back to top
voirtech at gmail.com
Guest





PostPosted: Sat May 23, 2009 12:36 am    Post subject: [asterisk-dev] undefined symbol: PQsetdbLogin

Quote:
>Do you build your module in the Asterisk tree or outside of it? The
>>MODULEINFO section is used by the Asterisk build system when ou build a

>>module in the tree.

I do the build of my module in Asterisk tree.  The module is in the asterisk source apps folder.  I run make, then make install and  the module compiles perfectly without any errors.




On Fri, May 22, 2009 at 8:10 PM, Tzafrir Cohen <tzafrir.cohen@xorcom.com (tzafrir.cohen@xorcom.com)> wrote:
Quote:
On Fri, May 22, 2009 at 11:06:55AM -0400, Joel Jn-Francois wrote:
> >> You need to link against libpq when you link the asterisk binary (the
> >> gcc -o / ld stage), e.g. -lpq.
> >>
>
> > And the way to do this is to place the following comment within your C
> source
> > file:
> >
> >/*** MODULEINFO
> >  <depend>pgsql</depend>
> > ***/
>
>
> Thanks everyone for your help.  I did add the following to my code, but I am
> still getting the exact error message.  I also made sure I deleted my old
> module and made sure the new module that was created is the one with
> <depend>pgsql</depend>.
>
> /*** MODULEINFO
>    <depend>pgsql</depend>
>  ***/
>
> Is there something else that I am doing wrong?


Do you build your module in the Asterisk tree or outside of it? The
MODULEINFO section is used by the Asterisk build system when you build a
module in the tree.

--
              Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen@xorcom.com ([email]jabber%3Atzafrir.cohen@xorcom.com[/email])
+972-50-7952406           mailto:tzafrir.cohen@xorcom.com (tzafrir.cohen@xorcom.com)
http://www.xorcom.com  iax:guest@local.xorcom.com/tzafrir


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev


Back to top
voirtech at gmail.com
Guest





PostPosted: Sun May 24, 2009 10:30 pm    Post subject: [asterisk-dev] undefined symbol: PQsetdbLogin

After no success with everything I tried, I downgraded to asterisk 1.4.25 and went back to my original code which worked perfectly on asterisk 1.4.21.  However, I am getting the same undefined symbol: PQsetdbLogin error in 1.4.25.  What I forgot to mention though, is that the module that is working in asterisk 1.4.21 is running on a different server.  Below are the specs for both servers:

Server with asterisk 1.4.21 with my asterisk c module running perfectly:
model name      : Intel(R) Pentium(R) 4 CPU 3.00GHz
processor       : 2
cpu MHz         : 3 Ghz
Operating System:  Fedora Core 5

Server with asterisk 1.4.25/1.6.1 that gives me undefined symbol: PQsetdbLogin when I tried to load the module in asterisk. This happens even though I include <depend>pgsql</depend> in the MODULEINFO in my source code.
model name      : Dual-Core AMD Opteron(tm) Processor 1216 HE
processor       : 2
cpu MHz         : 2.2 Ghz
cpu cores       : 2
clflush size    : 64
cache_alignment : 64
Operating System: Centos 5 (64 bit)

I hope this information will shed some more light into my problem.

Thanks everyone.




On Fri, May 22, 2009 at 9:23 PM, Joel Jn-Francois <voirtech@gmail.com (voirtech@gmail.com)> wrote:
Quote:
>>Do you build your module in the Asterisk tree or outside of it? The

>>MODULEINFO section is used by the Asterisk build system when ou build a
>>module in the tree.

I do the build of my module in Asterisk tree.  The module is in the asterisk source apps folder.  I run make, then make install and  the module compiles perfectly without any errors.





On Fri, May 22, 2009 at 8:10 PM, Tzafrir Cohen <tzafrir.cohen@xorcom.com (tzafrir.cohen@xorcom.com)> wrote:
Quote:
On Fri, May 22, 2009 at 11:06:55AM -0400, Joel Jn-Francois wrote:
> >> You need to link against libpq when you link the asterisk binary (the
> >> gcc -o / ld stage), e.g. -lpq.
> >>
>
> > And the way to do this is to place the following comment within your C
> source
> > file:
> >
> >/*** MODULEINFO
> >  <depend>pgsql</depend>
> > ***/
>
>
> Thanks everyone for your help.  I did add the following to my code, but I am
> still getting the exact error message.  I also made sure I deleted my old
> module and made sure the new module that was created is the one with
> <depend>pgsql</depend>.
>
> /*** MODULEINFO
>    <depend>pgsql</depend>
>  ***/
>
> Is there something else that I am doing wrong?


Do you build your module in the Asterisk tree or outside of it? The
MODULEINFO section is used by the Asterisk build system when you build a
module in the tree.

--
              Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen@xorcom.com ([email]jabber%3Atzafrir.cohen@xorcom.com[/email])
+972-50-7952406           mailto:tzafrir.cohen@xorcom.com (tzafrir.cohen@xorcom.com)
http://www.xorcom.com  iax:guest@local.xorcom.com/tzafrir


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev






Back to top
voirtech at gmail.com
Guest





PostPosted: Fri May 29, 2009 3:54 pm    Post subject: [asterisk-dev] undefined symbol: PQsetdbLogin

Was anyone able to figure out what I might be doing wrong on my end?


Quote:
After no success with everything I tried, I downgraded to asterisk 1.4.25 and went back to my original code which worked perfectly on asterisk 1.4.21.  However, I am getting the same undefined symbol: PQsetdbLogin error in 1.4.25.  What I forgot to mention though, is that the module that is working in asterisk 1.4.21 is running on a different server.  Below are the specs for both servers:

Server with asterisk 1.4.21 with my asterisk c module running perfectly:
model name      : Intel(R) Pentium(R) 4 CPU 3.00GHz
processor       : 2
cpu MHz         : 3 Ghz
Operating System:  Fedora Core 5

Server with asterisk 1.4.25/1.6.1 that gives me undefined symbol: PQsetdbLogin when I tried to load the module in asterisk. This happens even though I include <depend>pgsql</depend> in the MODULEINFO in my source code.
model name      : Dual-Core AMD Opteron(tm) Processor 1216 HE
processor       : 2
cpu MHz         : 2.2 Ghz
cpu cores       : 2
clflush size    : 64
cache_alignment : 64
Operating System: Centos 5 (64 bit)

I hope this information will shed some more light into my problem.

Thanks everyone.





On Fri, May 22, 2009 at 9:23 PM, Joel Jn-Francois <voirtech@gmail.com (voirtech@gmail.com)> wrote:
Quote:
>>Do you build your module in the Asterisk tree or outside of it? The

>>MODULEINFO section is used by the Asterisk build system when ou build a
>>module in the tree.

I do the build of my module in Asterisk tree.  The module is in the asterisk source apps folder.  I run make, then make install and  the module compiles perfectly without any errors.





On Fri, May 22, 2009 at 8:10 PM, Tzafrir Cohen <tzafrir.cohen@xorcom.com (tzafrir.cohen@xorcom.com)> wrote:
Quote:
On Fri, May 22, 2009 at 11:06:55AM -0400, Joel Jn-Francois wrote:
> >> You need to link against libpq when you link the asterisk binary (the
> >> gcc -o / ld stage), e.g. -lpq.
> >>
>
> > And the way to do this is to place the following comment within your C
> source
> > file:
> >
> >/*** MODULEINFO
> >  <depend>pgsql</depend>
> > ***/
>
>
> Thanks everyone for your help.  I did add the following to my code, but I am
> still getting the exact error message.  I also made sure I deleted my old
> module and made sure the new module that was created is the one with
> <depend>pgsql</depend>.
>
> /*** MODULEINFO
>    <depend>pgsql</depend>
>  ***/
>
> Is there something else that I am doing wrong?


Do you build your module in the Asterisk tree or outside of it? The
MODULEINFO section is used by the Asterisk build system when you build a
module in the tree.

--
              Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen@xorcom.com ([email]jabber%3Atzafrir.cohen@xorcom.com[/email])
+972-50-7952406           mailto:tzafrir.cohen@xorcom.com (tzafrir.cohen@xorcom.com)
http://www.xorcom.com  iax:guest@local.xorcom.com/tzafrir


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev










Back to top
Display posts from previous:   
   AsteriskGuru Archives Forum Index -> Asterisk-Dev All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™