首页 > 代码库 > postgresql c library use
postgresql c library use
#include <stdio.h> #include <libpq-fe.h> int main() { int lib_ver = PQlibVersion(); printf("Version of libpq: %d\n", lib_ver); return 0; }
all: gcc -o ex_02.exe ex_02.c -I"D:/Program Files/PostgreSQL/9.5/include" -L"D:/Program Files/PostgreSQL/9.5/lib" -lpq -std=c99 clean: rm -rf ex_02.exe
注: 在使用 win7 编译的时候,需要注意gcc 版本,ld 版本,libpq.dll 版本 win版本,要一至都是 64bit 或 32bit,
当写 Makefile 文件 出现 Creaeprocess failed 时,说明 rm 命令没有找到,把rm 命令所在位置添加到path 里面。
postgresql c library use
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。