在dll libmysql.dll中找不到过程入口点mysql_get_option
The procedure entry point mysql_get_option could not be located in the dll libmysql.dll
我只是使用mysql站点中的示例代码。如果我在调试中执行此程序,它将编译并运行。如果我在发行版中编译,它会在标题中给我错误。我从oracle网站下载了所有的连接器和服务器,所以我的一切都是最新的。我甚至编译了c++连接器和c连接器的最新版本。我对此做了很多搜索,并尝试了他们说要做的事情,但无法解决这个问题。我所看到的lib和dll文件中列出了mysql_get_option函数。我确保我的计算机上没有杂散的dll或lib文件。我检查了系统路径变量,以确保它没有指向某个随机区域。我正在使用Vs2013。
请帮帮我,我已经试着解决这个问题一周了,我的大脑快要爆炸了!!谢谢你的建议。
p.S。我编程是一种爱好,所以我很可能忽略了一些琐碎的事情。
/* Copyright 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
There are special exceptions to the terms and conditions of the GPL
as it is applied to this software. View the full text of the
exception in file EXCEPTIONS-CONNECTOR-C++ in the directory of this
software distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Standard C++ includes */
#include <stdlib.h>
#include <iostream>
/*
Include directly the different
headers from cppconn/ and mysql_driver.h + mysql_util.h
(and mysql_connection.h). This will reduce your build time!
*/
#include "mysql_connection.h"
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
using namespace std;
int main(void)
{
cout << endl;
cout << "Running 'SELECT 'Hello World0000........ AS _message'..." << endl;
try {
sql::Driver *driver;
sql::Connection *con;
sql::Statement *stmt;
sql::ResultSet *res;
/* Create a connection */
driver = get_driver_instance();
con = driver->connect("*****", "*****", "*****");
/* Connect to the MySQL test database */
//con->setReadOnly(true);
con->setSchema(*****);
cout << "nHere!";
stmt = con->createStatement();
res = stmt->executeQuery("SELECT DISTINCT eqdkp10_raid_attendees.raid_id, eqdkp10_raids.raid_value
FROM eqdkp10_raids LEFT JOIN eqdkp10_raid_attendees ON eqdkp10_raids.raid_id
= eqdkp10_raid_attendees.raid_id AND eqdkp10_raid_attendees.member_id=2");
while(res->next()) {
cout << "t... MySQL replies: ";
/* Access column data by alias or column name */
cout << res->getString("_message") << endl;
cout << "t... MySQL says it again: ";
/* Access column fata by numeric offset, 1 is the first column */
cout << res->getString(1) << endl;
}
delete res;
delete stmt;
delete con;
}
catch(sql::SQLException &e) {
cout << "# ERR: SQLException in " << __FILE__;
cout << "(" << __FUNCTION__ << ") on line " << __LINE__ << endl;
cout << "# ERR: " << e.what();
cout << " (MySQL error code: " << e.getErrorCode();
cout << ", SQLState: " << e.getSQLState() << " )" << endl;
}
cout << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
我在谷歌上搜索了你的帖子标题,找到了这个链接:http://www.linuxtalks.net/mysql-community-server-5-7-4-m14-has-been-released/
如果你在页面上搜索mysql_get_option,你会发现他们修复了这个已知的错误。如果您使用的是VS2013,您的库版本可能会包含此错误,因为该页面引用了2014年的版本。
相关文章:
- 挂起和取消挂起一个文件DLL
- std::threads可以从Windows DLL中的全局变量创建/销毁吗?
- C++MySQL C api用户输入行
- 导入库可以跨dll版本工作吗
- 从C++dll访问C#中的一行主要参数
- 链接到自行创建的dll失败
- 为什么使用 P/Invoke 调用 dll 时,某些计算机中的 LoadLibrary 失败?
- 使用cmake从源代码构建MySQL连接器/C++失败(与以前的声明冲突)
- 在调用FreeLibrary后,释放动态链接到具有相同版本的CRT堆的DLL的内存
- 如何指定我希望我的LIB链接到的DLL文件?-Visual Studio 2019
- 如何将图像传输到c++(dll)中的缓冲区,然后在c#的缓冲区中读/写
- C++:将外部库链接到dll库
- 在 Windows 上,是否可以让 dll 在不使用 PATH 环境变量的情况下在另一个文件夹中查找依赖项?
- 不同的Visual Studio版本中缺少.dll
- 从DLL中删除类的实例
- 如何使用 c++ 将 Mysql.data.dll 添加到 uwp 中?
- libmysql.dll中存在C++MySQL错误
- VS2013 c++connect mysql--Libmysql.dll中出现错误
- 加载libmysql.dll连接mySQL数据库
- 正在将MySql.Data.dll添加到Qt C++中