3

我有问题,我使用 mysql++ 3.1.0:在为 vc2008 以调试和发布模式构建 mysql++.sln 后,使用 instal.hta 然后将 vc++ 目录中的 dirrectoires 添加到 lib 和包含文件夹,并添加项目属性-> 链接器- > General Additional Library Directories 目录到 lib 文件夹,其中有 mysqlpp.dll、mydqlpp.lib、mysqlpp_d.dll、mydqlpp_d.lib。这些代码:

#include <iostream>
#include <mysql++.h>
using namespace std;
using namespace mysqlpp;

int main()
{
    Connection con;

    return 0;
}

得到这些错误:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall mysqlpp::Connection::~Connection(void)" (__imp_??1Connection@mysqlpp@@UAE@XZ) referenced in function _main
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mysqlpp::Connection::Connection(bool)" (__imp_??0Connection@mysqlpp@@QAE@_N@Z) referenced in function _main

在 Visual Studio 2008 中。我该如何解决这个问题?

4

1 回答 1

2

我想你错过了这里的最后一步,它为你的项目添加了几个库:MySQL++ DLL 导入库、MySQL C API 库和 Winsock DLL 导入库。

于 2011-03-28T22:47:26.610 回答