Linker Error for Postgresql lib

I’m trying to compile logger.c file by including libpq-fe.h header file, but linker is giving me error Undefined reference to some_function present in above header file. I know that this means the linker is unable to link the function declared in header file to its definition in some lib file.

But, the same library is working fine with cdr_pgsql.c file. I wanted to know if I’ve to include some flags while doing make && make install

Asterisk Version : 15.4.0
Postresql Lib and server both are installed and I’ve tested the library by making a different c program and calling postgres api and I’m able to connect to db successfully.

Please, can you assist me in rectifying this linker issue.


@jcolp @david551 Sorry to bother you guys but, please help me out here.

If I had anything to add I would. The only documentation that exists that I know of is for modules, which is different I believe. We add new dependencies to the core rarely, if ever. My only suggestion is to look and see about other things that are linked in and how it is done for them.

1 Like

It is quite rude to personally tag someone onto an issue simply because you’ve not gotten the response you like, or because you’ve not gotten any response at all. Please, do not do this again.

1 Like

Sorry, about that. Won’t happen again. :slight_smile:

1 Like