libpq-dev - GCC 12.x cannot find postgresql includes unless -I directive used

Asked by Martin Cordova

This is related to package libpq-dev on Ubuntu 22.04
https://packages.ubuntu.com/jammy/libpq-dev

In order for the compiler to auto-find the header files, it seems that the /postgresql directory in /usr/include should be relocated to /usr/include/x86_64-linux-gnu, like libcurl4-openssl-dev and libssl-dev packages do, otherwise an include directive "-I" must be given to the compiler arguments, like:

-I/usr/include/postgresql

If this include directive is not given, then compilation fails because the compiler for some reason cannot find pgsql header files. Maybe /usr/include should be enough, but I observe that other libs do install their headers in /usr/include/x86_64-linux-gnu and they can be found without any include directive passed to the compiler.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu postgresql-14 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I suggest you report a bug

Can you help with this problem?

Provide an answer of your own, or ask Martin Cordova for more information if necessary.

To post a message you must log in.