Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can resolve this issue by following these steps:

  1. Install the PostgreSQL development package:

    sudo apt-get update
    sudo apt-get install postgresql-server-dev-all
    
  2. 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.

  3. Export the header file directory path:

    export C_INCLUDE_PATH=/usr/include/postgresql/
    
  4. 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.

  5. Run your program:

    ./program