The error is stating that you have no definition of that static variable anywhere in the translation unit. For this to work you’ll have to add something like the following to your cpp:
But I’m a little concerned that this isn’t really what you want - I can see that you’re adding libTextures to the root, but it seems like these things would be better housed within an instance of a singleton, rather than all being static themselves. As such they’d better afford the protection of being UPROPERTIES.
UE4 reflaction system is not dealing well with global and static (except functions) things
Instead of making static function and variables create non-static manager class which you spawn and attack to PlayerController or Character (considering you want to create inventory system), then for easy access you can create a static function which gets manager from player controller or if you gonna have only single character with that menager you cna do the same with character or pawn
In UE3 inventory system (which got removed in UE4 as it was mainly done for shooters) Inventory was managed by InventoryManager class which was attached to pawns (so every pawn could have inventory even if it’s AI), check it out for inspiration:
I tried adding those three lines to my .cpp, and then I get this error: Error 1 error C2655: 'UItemList::itemList' : definition or redeclaration illegal in current scope
By the way, I’m not very good at c++ yet, I’m just trying to learn at the moment.
Those definitions need to exist at the global scope, rather than inside a function. I should reiterate though, making all this stuff static isn’t advisable. You’re better off not having any of this static, and accessing the data through an instance of UItemList