gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 07:35:18 24 4
gpt4 key购买 nike

我在 Windows 7 x64 上使用 VS 2012。我的 friend 为我编写了使用 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 错误。 screenshot我安装了 postgres 并加载了一些项目属性的路径:screenshot我希望你能给我一个快速指导,如何让他的代码在我的项目中工作。

最佳答案

您必须在 Linker - Input to be linked 中明确指定附加库 libpq.lib,而不是仅提供库路径。

关于c++ - 在 VS 2012 项目中使用 libpq (PostgreSQL) 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16866591/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com