"Cannot find a library instance of ..."
Hey,
I've played around with some own addons and I just got familiar with LibAddonMenu-2.0 library. On Wiki there were some great instructions and I learned a lot how to use it. But I don't really understand why two other libraries does not work whatsoever. I'm trying to use LibScroll and libChat2. So here's what I've done:
In my LUA I have the following code (in the very beginning of the file): Code:
local LibAM = LibStub:GetLibrary("LibAddonMenu-2.0") Any help here? :o |
There is nothing special with libraries. They are just Lua code as everything else.
Means: The load order matters. => Something, not declared yet, is unknown. In your manifest LibStub must come first, then all libs you want to use and last comes your main file using them. Typos in paths are silently ignored. Show us your manifest.txt. |
Problem solved, thanks votan!
Did not know and nobody ever mentioned it anywhere that you must load libraries before your own LUA and XML files. Did not think the load order matters. |
If you are a simple user from 2020 and have same problem, for example
"user:/AddOns/GearSetsSort/GearSetsSort.lua:328: Cannot find a library instance of "LibAddonMenu-2.0". where is a fix: change line in GearSetsSort.lua file from " local LAM = LibStub('LibAddonMenu-2.0') " to "local LAM = LibAddonMenu2". |
Additional information about libraries can be read here, especially why LibStub is obsolete meanwhile and should not be used anymore (where not needed):
https://wiki.esoui.com/Libraries#Lib...ersion_control |
All times are GMT -6. The time now is 06:14 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI