我不明白为什么会出现不满意的链接错误

xoefb8l8  于 2021-06-30  发布在  Java
关注(0)|答案(1)|浏览(333)

我找不到为什么我的代码返回不满意的链接错误。

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
谢谢!

cotxawn7

cotxawn71#

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

相关问题