我无法弄清楚为什么会出现不满意的链接错误



我找不到我的代码返回不满意链接错误的原因。

java.lang.UnsatisfiedLinkError: 'void fr.bastoup.spigotplusplus.link.CPPLink.loadPlugin(java.lang.String)'
at fr.bastoup.spigotplusplus.link.CPPLink.loadPlugin(Native Method) ~[?:?]
at fr.bastoup.spigotplusplus.link.CPPLink.loadPlugin(CPPLink.java:17) ~[?:?]
at fr.bastoup.spigotplusplus.SpigotPlusPlus.onEnable(SpigotPlusPlus.java:11) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot-1.16.4.jar:git-Spigot-a19903d-5b74714]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) ~[spigot-1.16.4.jar:git-Spigot-a19903d-5b74714]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-1.16.4.jar:git-Spigot-a19903d-5b74714]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:494) ~[spigot-1.16.4.jar:git-Spigot-a19903d-5b74714]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:408) ~[spigot-1.16.4.jar:git-Spigot-a19903d-5b74714]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:435) ~[spigot-1.16.4.jar:git-Spigot-a19903d-5b74714]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:218) ~[spigot-1.16.4.jar:git-Spigot-a19903d-5b74714]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809) ~[spigot-1.16.4.jar:git-Spigot-a19903d-5b74714]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.4.jar:git-Spigot-a19903d-5b74714]

然而,我的.so文件是正确生成的,并且似乎被加载了,因为当我尝试加载它时没有错误。

$ nm -DC native/Linux/x86_64/cpplink.so 
U __cxa_atexit
w __cxa_finalize
w __gmon_start__
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
00000000000011a9 T Java_fr_bastoup_spigotplusplus_link_CPPLink_loadPlugin(JNIEnv_*, _jclass**, _jstring**)
U std::ios_base::Init::Init()
U std::ios_base::Init::~Init()
U std::cout
U std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)
U std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)

我找了一个多月的答案,但我不知道。如果有人知道,那就太好了!

以下是github回购:https://github.com/BastouP411/SpigotPlusPlus

谢谢!

好吧,我刚刚忘记在.cpp中包含我的头文件。现在解决了!

最新更新