现在我有一个 Unity (C#) 项目,它从 dll 调用我的 C++ 项目。它们都运行良好,例如从 Unity 调用 C++ 函数。但是,当我尝试在 C++ 项目中添加一行来调用另一个库(NLOpt 库,来自另一个 dll)的函数时,生成的 dll 变得无法在 Unity 项目中加载。插件.hextern "C" __declspec(dllexport) bool __stdcall LoadData(int agent_num, int frame_num, float* data);插件.cpp#include "Plugin.h"#include <nlopt.h>__declspec(dllexport) bool __stdcall LoadData(int agent_num, int frame_num, float* d){ ... nlopt_opt opt = nlopt_create(NLOPT_LN_COBYLA, 3); //this line}当我添加上面的行时,Unity 将出现以下错误:Plugins: Failed to load 'Assets/Plugins/BirdOpti/BirdOpti.dll'和DllNotFoundException: Opti我已经尝试了几次,所以我确定问题出在线路上。我做错什么了吗?
添加回答
举报
0/150
提交
取消
