[英]libpq: which lib files should I use
I used the PostgreSQL as my data base and I am coding a c++ project, so I have to use the libpq to connect it. 我使用PostgreSQL作为数据库,并且正在编写c ++项目,因此必须使用libpq进行连接。
I have already found the include file and lib file in the PostgreSQL file but there are too many files. 我已经在PostgreSQL文件中找到了include文件和lib文件,但是文件太多。 I think I don't need to add them all.
我想我不需要全部添加它们。
For the include file, I just added libpq-fe.h
, pg_config_ext.h
and postgres_ext.h
, then I included the libpq-fe.h
, it seems that everything goes well, I can call some functions such as PQconnectdb
, PQexec
etc. But when I compile it, I get some LNK errors, meaning that I didn't add the right lib files. 对于包含文件,我只添加了
libpq-fe.h
, pg_config_ext.h
和postgres_ext.h
,然后包含了libpq-fe.h
,看来一切正常,我可以调用一些函数,例如PQconnectdb
, PQexec
等但是,当我编译它时,出现了一些LNK错误,这意味着我没有添加正确的lib文件。
I've tried to add libpq.lib
and libpq.dll
, but I still got the LNK errors. 我试图添加
libpq.lib
和libpq.dll
,但是我仍然遇到LNK错误。
Does someone know which lib files should I add? 有人知道我应该添加哪些lib文件吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.