• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Eluna + PCH compiles ok, but worldserver link fails

Status
Not open for further replies.

Kylroi

Enthusiast
I have tried numerous searches and found nothing that actually covered the error situation that I encountered. So, here I am with a heads up and question.

Not that this matters, but my system configuration is an x64 install of Fedora 20 (Linux, for those not familiar with that distribution). It uses gcc 4.8.2, just in case this factors in to the cause of the issue.

I have the 52a5213e462b hash of TrinityCore branch 4.3.4, with 3 other patches that I can compile and link just fine. Of those 3 patches, 1 is not my own doing, but I did apply a code change to make it work with the 4.3.4 branch (simple variable declaration issue). There are no common files patched between these 3 patches and Eluna, so it should not be a conflict in that regard. However, when I add Eluna to the mix, I can only get a successful link of worldserver if I compile with USE_COREPCH=0 set for cmake. If I leave the precompiled headers at default (enabled), the make process gets stopped with the following:

Code:
Linking CXX executable worldserver
../game/libgame.a(GridNotifiers.cpp.o): In function `Trinity::DelayedUnitRelocation::Visit(GridRefManager<Player>&)':
GridNotifiers.cpp:(.text+0x3056): undefined reference to `void Player::UpdateVisibilityOf<AreaTrigger>(AreaTrigger*, UpdateData&, std::set<Unit*, std::less<Unit*>, std::allocator<Unit*> >&)'
GridNotifiers.cpp:(.text+0x3b48): undefined reference to `void Player::UpdateVisibilityOf<AreaTrigger>(AreaTrigger*, UpdateData&, std::set<Unit*, std::less<Unit*>, std::allocator<Unit*> >&)'
GridNotifiers.cpp:(.text+0x3e72): undefined reference to `void Player::UpdateVisibilityOf<AreaTrigger>(AreaTrigger*, UpdateData&, std::set<Unit*, std::less<Unit*>, std::allocator<Unit*> >&)'
GridNotifiers.cpp:(.text+0x427d): undefined reference to `void Player::UpdateVisibilityOf<AreaTrigger>(AreaTrigger*, UpdateData&, std::set<Unit*, std::less<Unit*>, std::allocator<Unit*> >&)'
GridNotifiers.cpp:(.text+0x4830): undefined reference to `void Player::UpdateVisibilityOf<AreaTrigger>(AreaTrigger*, UpdateData&, std::set<Unit*, std::less<Unit*>, std::allocator<Unit*> >&)'
../game/libgame.a(GridNotifiers.cpp.o):GridNotifiers.cpp:(.text+0x4c56): more undefined references to `void Player::UpdateVisibilityOf<AreaTrigger>(AreaTrigger*, UpdateData&, std::set<Unit*, std::less<Unit*>, std::allocator<Unit*> >&)' follow
collect2: error: ld returned 1 exit status
make[2]: *** [src/server/worldserver/worldserver] Error 1
make[1]: *** [src/server/worldserver/CMakeFiles/worldserver.dir/all] Error 2
make: *** [all] Error 2

Is this a known problem that is on a TODO list? Granted, I am able to work around the issue by adding "-DUSE_COREPCH=0" to my cmake argument list. Just to be clear, the above errors only occur if USE_COREPCH is left enabled (default).
 

Foereaper

Founder
The cataclysm branch is very far behind the wrath one, as trinity's cataclysm is very far behind the other. Thus updating it is a pita, and not something we've really focused on lately
 

Kylroi

Enthusiast
Fair enough. It really wasn't difficult to get Eluna into the 4.3.4 code, though. I currently have 3 copies of the source: unaltered, in-use with patches, and a copy to play with. All I did was use diff to create a patch (with 'diff -durp --unidirectional-new-file orig/ ElunaCata/') to add Eluna to my "play" tree. I did alter the Eluna source in a couple places, but it wasn't critical needs (a type cast to eliminate a warning, and renamed 3 unused enums to be in sync with Trinity). It all seems to work fine, so long as USE_COREPCH isn't enabled, so your Cataclysm code appears to be fairly close.

So long as the Cataclysm tree is on a TODO list (to bring it up to date), I can probably handle the necessary changes to keep using it. Basically, since I was unable to locate a post with the same error, I thought that I'd mention it. As I said, I can simply disable USE_COREPCH and it links fine, so it could be a gcc issue with something in your code. All i know is that when I was using a Windows platform, VC2010 could leave USE_COREPCH enabled and it would link worldserver.exe just fine with Eluna added.
 

Foereaper

Founder
Fair enough. It really wasn't difficult to get Eluna into the 4.3.4 code, though. I currently have 3 copies of the source: unaltered, in-use with patches, and a copy to play with. All I did was use diff to create a patch (with 'diff -durp --unidirectional-new-file orig/ ElunaCata/') to add Eluna to my "play" tree. I did alter the Eluna source in a couple places, but it wasn't critical needs (a type cast to eliminate a warning, and renamed 3 unused enums to be in sync with Trinity). It all seems to work fine, so long as USE_COREPCH isn't enabled, so your Cataclysm code appears to be fairly close.

So long as the Cataclysm tree is on a TODO list (to bring it up to date), I can probably handle the necessary changes to keep using it. Basically, since I was unable to locate a post with the same error, I thought that I'd mention it. As I said, I can simply disable USE_COREPCH and it links fine, so it could be a gcc issue with something in your code. All i know is that when I was using a Windows platform, VC2010 could leave USE_COREPCH enabled and it would link worldserver.exe just fine with Eluna added.

Yeah, complete GCC support is also a WIP :)
 

Kylroi

Enthusiast
Good enough. Not that you need this, but:

Code:
diff --git a/TrinityCore/Cataclysm/src/LuaEngine/LuaEngine.cpp b/TrinityCore/Cataclysm/src/LuaEngine/LuaEngine.cpp
index 3170363..89e03ed 100644
--- a/TrinityCore/Cataclysm/src/LuaEngine/LuaEngine.cpp
+++ b/TrinityCore/Cataclysm/src/LuaEngine/LuaEngine.cpp
@@ -90,7 +90,7 @@ void StartEluna(bool restart)
     TC_LOG_INFO("misc", "");
 
     LoadedScripts loadedScripts;
-    sEluna->LoadDirectory("lua_scripts", &loadedScripts);
+    sEluna->LoadDirectory((char *)"lua_scripts", &loadedScripts);
     luaL_openlibs(sEluna->L);
     // Register functions here
     RegisterFunctions(sEluna->L);
@@ -693,4 +693,4 @@ uint32 LuaTaxiMgr::AddPath(std::list<TaxiPathNodeEntry> nodes, uint32 mountA, ui
         return 0;
     sTaxiPathSetBySource[startNode][nodeId - 1] = TaxiPathBySourceAndDestination(pathId, price);
     return pathId;
-}
\ No newline at end of file
+}
diff --git a/TrinityCore/Cataclysm/src/server/game/Accounts/RBAC.h b/TrinityCore/Cataclysm/src/server/game/Accounts/RBAC.h
index 45617bf..4d3d4c7 100644
--- a/TrinityCore/Cataclysm/src/server/game/Accounts/RBAC.h
+++ b/TrinityCore/Cataclysm/src/server/game/Accounts/RBAC.h
@@ -517,7 +517,7 @@ enum RBACPermissions
     RBAC_PERM_COMMAND_RELOAD_ALL                             = 611,
     RBAC_PERM_COMMAND_RELOAD_ALL_ACHIEVEMENT                 = 612,
     RBAC_PERM_COMMAND_RELOAD_ALL_AREA                        = 613,
-    RBAC_PERM_COMMAND_RELOAD_ALL_EVENTAI                     = 614,
+    RBAC_PERM_UNUSED_614                                     = 614, // unused
     RBAC_PERM_COMMAND_RELOAD_ALL_GOSSIP                      = 615,
     RBAC_PERM_COMMAND_RELOAD_ALL_ITEM                        = 616,
     RBAC_PERM_COMMAND_RELOAD_ALL_LOCALES                     = 617,
@@ -534,8 +534,8 @@ enum RBACPermissions
     RBAC_PERM_COMMAND_RELOAD_COMMAND                         = 628,
     RBAC_PERM_COMMAND_RELOAD_CONDITIONS                      = 629,
     RBAC_PERM_COMMAND_RELOAD_CONFIG                          = 630,
-    RBAC_PERM_COMMAND_RELOAD_CREATURE_AI_SCRIPTS             = 631,
-    RBAC_PERM_COMMAND_RELOAD_CREATURE_AI_TEXTS               = 632,
+    RBAC_PERM_UNUSED_631                                     = 631, // unused
+    RBAC_PERM_UNUSED_632                                     = 632, // unused
     RBAC_PERM_COMMAND_RELOAD_CREATURE_LINKED_RESPAWN         = 633,
     RBAC_PERM_COMMAND_RELOAD_CREATURE_LOOT_TEMPLATE          = 634,
     RBAC_PERM_COMMAND_RELOAD_CREATURE_ONKILL_REPUTATION      = 635,
@@ -678,12 +678,12 @@ enum RBACPermissions
     RBAC_PERM_COMMAND_WP_UNLOAD                              = 772,
     RBAC_PERM_COMMAND_WP_RELOAD                              = 773,
     RBAC_PERM_COMMAND_WP_SHOW                                = 774,
-       RBAC_PERM_COMMAND_MODIFY_CURRENCY                                                = 775, // only 4.3.4
-       RBAC_PERM_COMMAND_DEBUG_PHASE                                                = 776, // Only 4.3.4
+    RBAC_PERM_COMMAND_MODIFY_CURRENCY                        = 775, // only 4.3.4
+    RBAC_PERM_COMMAND_DEBUG_PHASE                            = 776, // Only 4.3.4
     /* Eluna */
-#ifdef ELUNA
+// Kylroi - #ifdef ELUNA
     RBAC_PERM_COMMAND_RELOAD_ELUNA                           = 900,
-#endif
+// Kylroi - #endif
     // custom permissions 1000+
     RBAC_PERM_MAX
 };
@@ -793,7 +793,7 @@ class RBACData
          * // previously defined "RBACData* rbac" with proper initialization
          * uint32 permissionId = 2;
          * if (rbac->GrantRole(permissionId) == RBAC_IN_DENIED_LIST)
-         *     TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Failed to grant permission %u, already denied", permissionId);
+         *     TC_LOG_DEBUG("entities.player", "Failed to grant permission %u, already denied", permissionId);
          * @endcode
          */
         RBACCommandResult GrantPermission(uint32 permissionId, int32 realmId = 0);
@@ -816,7 +816,7 @@ class RBACData
          * // previously defined "RBACData* rbac" with proper initialization
          * uint32 permissionId = 2;
          * if (rbac->DenyRole(permissionId) == RBAC_ID_DOES_NOT_EXISTS)
-         *     TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Role Id %u does not exists", permissionId);
+         *     TC_LOG_DEBUG("entities.player", "Role Id %u does not exists", permissionId);
          * @endcode
          */
         RBACCommandResult DenyPermission(uint32 permissionId, int32 realmId = 0);
@@ -840,7 +840,7 @@ class RBACData
          * // previously defined "RBACData* rbac" with proper initialization
          * uint32 permissionId = 2;
          * if (rbac->RevokeRole(permissionId) == RBAC_OK)
-         *     TC_LOG_DEBUG(LOG_FILTER_PLAYER, "Permission %u succesfully removed", permissionId);
+         *     TC_LOG_DEBUG("entities.player", "Permission %u succesfully removed", permissionId);
          * @endcode
          */
         RBACCommandResult RevokePermission(uint32 permissionId, int32 realmId = 0);

There's the changes I made. I'm sure you can easily see what I altered. You may notice the commenting out of the #ifdef/#endif pair around your enum. If that wasn't done, a cmake with -DELUNA=0 would result in a compile error in cs_reload.cpp.
 
Last edited:
Status
Not open for further replies.
Top