[asterisk-dev] undefined symbol: PQsetdbLogin

Alex Balashov abalashov at evaristesys.com
Thu May 21 23:07:47 CDT 2009


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

Joel Jn-Francois wrote:

> 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



More information about the asterisk-dev mailing list