为了方便地访问MySQL,我尝试使用SOCI库,但我不得不安装这个库。
到目前为止我所做的是:
下面是我的附加包含目录:http://puu.sh/6qGNP.png
但是,在编译示例程序时,我得到了一些链接器错误,如下所示:
1>main.obj : error LNK2019:未解析的外部符号"public:虚拟__thiscall LNK2019 (??1standard_into_type@details@soci@@UAE@XZ)“中引用的函数"public: Virtual__thiscall soci::details::into_type::~into_type(void)”(??1?$into_type@H@details@soci@@UAE@XZ) 1>main.obj : error LNK2001:未决外部符号“受保护”:虚拟__thiscall __thiscall( (?post_fetch@standard_into_type@details@soci@@MAEX_N0@Z) )
我在哪里搞砸了?
发布于 2015-04-01 23:01:17
从文件中:
所需客户图书馆
SOCI MySQL后端需要MySQL的高级libmysqlclient客户端库。
请注意,套接字库本身也依赖于自愿的libdl,因此编译基本客户端程序所需的库的最小集合是:
-lsoci_core -lsoci_mysql -ldl -lmysqlclient
这对我来说一直都很管用。如果要从构建位置链接它们,则需要将具有库路径的-L开关传递给编译器。
https://stackoverflow.com/questions/21221170
复制相似问题