UE4连接Mysql数据库解决方案
RulesAssembly RA;
FileReference CheckProjectFile;
UProjectInfo.TryGetProjectForTarget("工程名", out CheckProjectFile);
RA = RulesCompiler.CreateProjectRulesAssembly(CheckProjectFile);
FileReference FR = RA.GetModuleFileName(this.GetType().Name);
string ModulePath = Path.GetDirectoryName(FR.CanonicalName);
using System.IO;namespace UnrealBuildTool.Rules
{public class MySQLSupport : ModuleRules{public MySQLSupport(ReadOnlyTargetRules Target) : base(Target){PrivateDependencyModuleNames.AddRange(new string[] {"Core","CoreUObject","Engine",});RulesAssembly RA;FileReference CheckProjectFile;UProjectInfo.TryGetProjectForTarget("VRHome", out CheckProjectFile);RA = RulesCompiler.CreateProjectRulesAssembly(CheckProjectFile);FileReference FR = RA.GetModuleFileName(this.GetType().Name);string ModulePath = Path.GetDirectoryName(FR.CanonicalName);//string ModulePath = Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); // gets the directory path of this module string ThirdPartyPath = Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); // gets the ThirdParty folder directory path string MySQLConnectorPath = ThirdPartyPath + "MySQL Connector.C6.1/"; // gets the MySQL Connector.C 6.1 folder path string MySQLConnectorLibraryPath = MySQLConnectorPath + "lib/"; // gets the path of the lib folder string MySQLConnectorIncludePath = MySQLConnectorPath + "include/"; // gets the path of the include folder string MySQLConnectorImportLibraryName = Path.Combine(MySQLConnectorLibraryPath, "libmysql.lib"); // gets the file path and name of the libmysql.lib static import library string MySQLConnectorDLLName = Path.Combine(MySQLConnectorLibraryPath, "libmysql.dll"); // gets the file path and name of libmysql.dll if (!File.Exists(MySQLConnectorImportLibraryName)) // check to ensure the static import lib can be located, or else we'll be in trouble {throw new BuildException(string.Format("{0} could not be found.", MySQLConnectorImportLibraryName)); // log an error message explaining what went wrong if not found }if (!File.Exists(MySQLConnectorDLLName)) // check to make sure the dll can be located or else we'll be in trouble {throw new BuildException(string.Format("{0} could not be found.", MySQLConnectorDLLName)); // log an error message explaining what went wrong if not found }PublicIncludePaths.Add(MySQLConnectorIncludePath); // add the "include" folder to our dependencies. I've chosen PrivateIncludePaths since I hide the mysql headers from external code PublicLibraryPaths.Add(MySQLConnectorLibraryPath); // add the "lib" folder to our dependencies PublicAdditionalLibraries.Add(MySQLConnectorImportLibraryName); // add libmysql.lib static import library as a dependency PublicDelayLoadDLLs.Add(MySQLConnectorDLLName); // add libmysql.dll as a dll RuntimeDependencies.Add(new RuntimeDependency("$(ProjectDir)/Binaries/Win64/libmysql.dll")); // 自动添加libmysql.dll到指定的打包目录中}}
}
UE4连接Mysql数据库解决方案相关推荐
- 在java中使用JDBC连接mysql数据库时的服务器时区值无法识别或表示多个时区的问题解决方案
项目场景: 在java中使用JDBC连接mysql数据库时,报以下的错:Exception in thread "main" java.sql.SQLException: The ...
- node 连不上 mysql_node连接mysql数据库遇到的问题和解决方案
今天安装了新版的MySQL(8.0.21),用node框架连接数据库的时候报了个错: Client does not support authentication protocol requested ...
- QSqlDatabase连接MySQL数据库提示driver not loaded的解决方案
QSqlDatabase连接MySQL数据库提示driver not loaded的解决方案 环境 VS2019 mysql Ver 14.14 Distrib 5.7.36, for Win64 ( ...
- mysql安装连接测试c_C连接MySQL数据库开发之Windows环境搭建及测试_MySQL
一.开发环境 Win8.1 64位.VS2013.MySQL5.5.3764位 MySQL安装目录为:C:/Program Files/MySQL/MySQL Server 5.5二.配置工程环境 首 ...
- vs中如何开发mysql_VS2015如何连接mySQL数据库图文
1.新建一个工程名叫mysql,编程环境选择c#,然后选择windows窗体应用程序,新建一个窗体用于显示查询到sql数据库的数据集 2.从工具箱向form1窗体上拖一个按钮和datagridview ...
- C连接MySQL数据库开发之Windows环境配置及测试
一.开发环境 Win8.1 64位.VS2013.MySQL5.5.3764位 MySQL安装目录为:C:\Program Files\MySQL\MySQL Server 5.5 二.配置工程环境 ...
- c mysql 内存泄露_c代码连接mysql数据库内存泄露的问题
一直使用C代码连接mysql数据库,今天用valgrind检测,发现存在内存泄露的问题 代码如下 MYSQL*connection; connection=mysql_init(); connecti ...
- Python——Python连接MySQL数据库
基本概念 PyMySQL:PyMySQL是封装了MySQL驱动的Python驱动,一个能使Python连接到MySQL的库. mysql-connector-python(MySQL Connecto ...
- C++踩坑之连接mysql数据库
C++踩坑之连接mysql数据库 实现的效果 https://www.cr173.com/soft/105990.html 下载connect C++ 安装软件 安装到D盘,安装32位即可 64位不要 ...
最新文章
- 二叉搜索树的第 k 大节点(递归,反中序遍历 + 提前返回)
- 迈向智慧化 物联网规模应用不断拓展
- oracle 创建 触发,Oracle 创建触发器
- 人脸识别技术大总结(1)——Face Detection Alignment
- 【bzoj1486】【[HNOI2009]梦幻布丁】启发式链表合并(详解)
- 微信支付分申请接入流程
- mac下beyond compare配置图
- 全栈深度学习第7期: 研究方向这么多,哪些是有有趣又潜力的呢?
- 永洪bi_案例分享!永洪BI助力知名三甲医院数字化转型升级
- python选课系统代码_python模拟选课系统
- 10本书,搞定这门全球1000万程序员在用的编程语言
- 初识生成器与生成器表达式 Day12
- php提示修改成功,提示修改成功后怎么换回原来的页面
- 啥他妈的是 Nginx?
- 永洪BI在 Linux/Unix 下 jdk 环境如何配置?
- 全开源!Office多人协作应用,在线编辑Word、Excel和PPT文档
- NPN型三极管基础知识解析
- linux子系统下载错误,Win10系统开启linux子系统报错“0x80070057”怎么办?
- 供应链金融科技产品的核心竞争力究竟是什么?
- Mac看电视直播(通过MUMU安卓模拟器+自定义直播软件apk)