Help Center/
GaussDB/
Developer Guide(Centralized_2.x)/
Application Development Guide/
Development Based on libpq/
Development Process
Updated on 2023-10-23 GMT+08:00
Development Process
Obtain release package provided by GaussDB.
To compile and connect to a libpq source program, perform the following operations:
- Decompress of GaussDB-Kernel-VxxxRxxxCxx-xxxxx-64bit-Libpq.tar.gz. The required header file is stored in the include folder, and the lib folder contains the required libpq library file.
In addition to libpq-fe.h, the include folder contains the header files postgres_ext.h, gs_thread.h, and gs_threadlocal.h by default. These three header files are the dependency files of libpq-fe.h.
- Include the libpq-fe.h header file.
#include <libpq-fe.h>
- Provide the -I directory option to provide the installation location of the header files. (Sometimes the compiler looks for the default directory, so this option can be ignored.) Example:
gcc -I (Directory where the header files are located) -L (Directory where the libpq library is located) testprog.c -lpq
- If the makefile is used, add the following options to variables CPPFLAGS, LDFLAGS, and LIBS:
CPPFLAGS += -I (Directory where the header files are located) LDFLAGS += -L (Directory where the libpq library is located) LIBS += -lpq
Parent topic: Development Based on libpq
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot