I have problem, I use mysql++ 3.1.0: after building mysql++.sln in debug and release mode for vc2008, and using instal.hta then adding dirrectoires in vc++ directories to lib and include folders, and adding in project properties-> Linker-> General Additional Library Directories directory to lib folder which have mysqlpp.dll, mydqlpp.lib, mysqlpp_d.dll, mydqlpp_d.lib. These code:

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

int main()
{
    Connection con;

    return 0;
}

gets these errors:

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

in visual studio 2008. How can I fix this?

有帮助吗?

解决方案

I think you missed the last step here, which adds several libraries to your project: the MySQL++ DLL import library, the MySQL C API library, and the Winsock DLL import library.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top