关于postgresql的连接(linux下c)

前端之家收集整理的这篇文章主要介绍了关于postgresql的连接(linux下c)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

利用GCC进行编译时报以下错误

/tmp/ccoMpdzH.o(.text+0x4a): undefined reference to `PQconnectdb'
/tmp/ccoMpdzH.o(.text+0x5d): undefined reference to `PQstatus'

原来在编译的时候需要加上链接-lpq

例如:gcc testlibpq.c-I /usr/local/postgre/include/ -L /usr/local/postgre/lib/ -lpq -o testlibpq.out

原文链接:https://www.f2er.com/postgresql/197459.html

猜你在找的Postgre SQL相关文章