繁体   English   中英

在VS 2012项目中使用libpq(PostgreSQL)库

[英]Using libpq (PostgreSQL) library in VS 2012 project

我正在将VS 2012与Windows 7 x64配合使用。 我的朋友为我编写了使用libpq的C ++类:

...
#include <libpq-fe.h>
const char* QStrToCStr(QString qstring);
void ShowInfoBox(QString string);
QString IToQS(int x);
QString DToQS(double x);

class BinderHandler
{
private:
    PGresult* DBResultPointer;
    PGconn* DBConnPointer;
...
}
void BinderHandler::DBConnect()
{
    DBConnPointer = PQsetdbLogin(this->pghost,this->pgport,
                                 this->pgoptions,this->pgtty,
                                 this->dbName,this->login,this->pwd);
}
...

每次尝试构建项目时,每次都会收到LNK2019错误。 屏幕快照我已经安装了postgres,并且加载了一些项目属性的路径: 屏幕快照我希望您可以给我一个快速指南,以了解如何使他的代码在我的项目中起作用。

您必须在要链接的链接器-输入中显式指定其他库libpq.lib,而不是仅提供库路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM