从网上下的mysql++的库,http://tangentsoft.net/mysql++/releases/mysql++-2.2.3.tar.gz
根据网上的编译方式,切换到cmd 下输入install lib编译,在c盘下又一个maysql++文件夹下面友include和lib子目录,但是lib目录下都是空的之后我建了一个vc的工程,包含了mysqpl++的头文件,工程目录吧mysql++的头和库都引入了,也引入了mysql的头和库~#include "stdafx.h"
#include "mysql++.h"
#include <iostream>
#include <string>using namespace std;
using namespace mysqlpp;
int _tmain(int argc, _TCHAR* argv[])
{
mysqlpp::Connection con;
return 0;
}
结果编译报错, error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual __thiscall mysqlpp::Connection::~Connection(void)" (__imp_??1Connection@mysqlpp@@UAE@XZ),该符号在函数 _wmain 中被引用
1>testsql2.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall mysqlpp::Connection::Connection(bool)" (__imp_??0Connection@mysqlpp@@QAE@_N@Z),该符号在函数 _wmain 中被引用。啊是没有lib文件啊,难道编译的手顺不对么~求解啊
根据网上的编译方式,切换到cmd 下输入install lib编译,在c盘下又一个maysql++文件夹下面友include和lib子目录,但是lib目录下都是空的之后我建了一个vc的工程,包含了mysqpl++的头文件,工程目录吧mysql++的头和库都引入了,也引入了mysql的头和库~#include "stdafx.h"
#include "mysql++.h"
#include <iostream>
#include <string>using namespace std;
using namespace mysqlpp;
int _tmain(int argc, _TCHAR* argv[])
{
mysqlpp::Connection con;
return 0;
}
结果编译报错, error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual __thiscall mysqlpp::Connection::~Connection(void)" (__imp_??1Connection@mysqlpp@@UAE@XZ),该符号在函数 _wmain 中被引用
1>testsql2.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall mysqlpp::Connection::Connection(bool)" (__imp_??0Connection@mysqlpp@@QAE@_N@Z),该符号在函数 _wmain 中被引用。啊是没有lib文件啊,难道编译的手顺不对么~求解啊
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货