You can resolve this issue by following these steps:
Install the PostgreSQL development package:
sudo apt-get update
sudo apt-get install postgresql-server-dev-all
Check if libpq-fe.h file exists:
find /usr -name libpq-fe.h
If the file is found, note the path and proceed to step 3. If not, try installing the package again.
Export the header file directory path:
export C_INCLUDE_PATH=/usr/include/postgresql/
Compile your program and link it with the PostgreSQL library:
gcc -o program program.c -lpq
Replace "program" with your program name and "program.c" with your program file name.
Run your program:
./program
Asked: 2022-03-31 11:00:00 +0000
Seen: 11 times
Last updated: Jul 08 '21