cmangos / issues

This repository is used as a centralized point for all issues regarding CMaNGOS.
179 stars 48 forks source link

🐛 [Bug Report] [WoTLK] Error Compiling @ GridNotifiers.cpp #2580

Closed adellaci closed 2 years ago

adellaci commented 2 years ago

Bug Details

Details below in 'Crash Log'

cmake version 3.16.3 gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 GNU Make 4.2.1

Steps to Reproduce

1.cmake ~/cmangos/wotlk -DCMAKE_INSTALL_PREFIX=~/wow-servers/wotlk -DBUILD_EXTRACTORS=On -DBUILD_AHBOT=ON -DBUILD_PLAYERBOT=ON -DPCH=0 -DDEBUG=0 -DBUILD_RECASTDEMOMOD=OFF 2.make -j8 3. 4.

Expected behavior

Complete compiling with out error

Suggested Workaround

N/A

Crash Log

/home/mangos/cmangos/wotlk/src/game/Grids/GridNotifiers.cpp: In member function ‘void MaNGOS::RespawnDo::operator()(Creature*) const’: /home/mangos/cmangos/wotlk/src/game/Grids/GridNotifiers.cpp:280:46: error: invalid use of incomplete type ‘class MapPersistentState’ 280 | u->GetMap()->GetPersistentState()->SaveCreatureRespawnTime(u->GetDbGuid(), time(nullptr)); | ^~ In file included from /home/mangos/cmangos/wotlk/src/game/Maps/MapManager.h:25, from /home/mangos/cmangos/wotlk/src/game/Entities/Unit.h:38, from /home/mangos/cmangos/wotlk/src/game/Entities/DynamicObject.h:25, from /home/mangos/cmangos/wotlk/src/game/Grids/GridNotifiers.h:26, from /home/mangos/cmangos/wotlk/src/game/Grids/GridNotifiers.cpp:19: /home/mangos/cmangos/wotlk/src/game/Maps/Map.h:53:7: note: forward declaration of ‘class MapPersistentState’ 53 | class MapPersistentState; | ^~~~~~ make[2]: [src/game/CMakeFiles/game.dir/build.make:7954: src/game/CMakeFiles/game.dir/Grids/GridNotifiers.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [CMakeFiles/Makefile2:702: src/game/CMakeFiles/game.dir/all] Error 2 make: [Makefile:130: all] Error 2

Core SHA1 Commit Hash

bab4ceac2caa4b53d880d249e1cbca0b94192afd

Database SHA1 Commit Hash

N/A

Operating System

Ubuntu 20.04.3 Server LTS

Client Version(s)

adellaci commented 2 years ago

Tested [TBC] - Compiles correctly

adellaci commented 2 years ago

Tested [Classic] - Compiles correctly

adellaci commented 2 years ago

@killerwife closed this in cmangos/mangos-wotlk@3c83d44

git rev-parse HEAD 3c83d445a242ccd5974ca039d5e46134a13d38e3

Maybe not related to changes you made as other commit have been add. Did another pull and compile after your commit, following error showed up;

/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp: In member function ‘void SpawnManager::Initialize()’:
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:51:42: error: invalid use of incomplete type ‘using element_type = struct SpawnGroupEntryContainer’ {aka ‘struct SpawnGroupEntryContainer’}
   51 |     for (auto& groupData : spawnGroupData->spawnGroupMap)
      |                                          ^~
In file included from /home/mangos/cmangos/wotlk/src/game/Maps/Map.h:40,
                 from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:20:
/home/mangos/cmangos/wotlk/src/game/Maps/MapDataContainer.h:28:8: note: forward declaration of ‘using element_type = struct SpawnGroupEntryContainer’ {aka ‘struct SpawnGroupEntryContainer’}
   28 | struct SpawnGroupEntryContainer;
      |        ^~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:54:13: error: invalid use of incomplete type ‘const struct SpawnGroupEntry’
   54 |         if (entry.DbGuids.empty())
      |             ^~~~~
In file included from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.h:24,
                 from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:19:
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnGroup.h:29:8: note: forward declaration of ‘struct SpawnGroupEntry’
   29 | struct SpawnGroupEntry;
      |        ^~~~~~~~~~~~~~~
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:56:13: error: invalid use of incomplete type ‘const struct SpawnGroupEntry’
   56 |         if (entry.Type == SPAWN_GROUP_CREATURE)
      |             ^~~~~
In file included from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.h:24,
                 from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:19:
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnGroup.h:29:8: note: forward declaration of ‘struct SpawnGroupEntry’
   29 | struct SpawnGroupEntry;
      |        ^~~~~~~~~~~~~~~
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:56:27: error: ‘SPAWN_GROUP_CREATURE’ was not declared in this scope
   56 |         if (entry.Type == SPAWN_GROUP_CREATURE)
      |                           ^~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:58:34: error: ‘sObjectMgr’ was not declared in this scope; did you mean ‘ObjectMgr’?
   58 |             if (m_map.GetId() != sObjectMgr.GetCreatureData(entry.DbGuids[0].DbGuid)->mapid)
      |                                  ^~~~~~~~~~
      |                                  ObjectMgr
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:58:61: error: invalid use of incomplete type ‘const struct SpawnGroupEntry’
   58 |             if (m_map.GetId() != sObjectMgr.GetCreatureData(entry.DbGuids[0].DbGuid)->mapid)
      |                                                             ^~~~~
In file included from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.h:24,
                 from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:19:
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnGroup.h:29:8: note: forward declaration of ‘struct SpawnGroupEntry’
   29 | struct SpawnGroupEntry;
      |        ^~~~~~~~~~~~~~~
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:63:34: error: ‘sObjectMgr’ was not declared in this scope; did you mean ‘ObjectMgr’?
   63 |             if (m_map.GetId() != sObjectMgr.GetGOData(entry.DbGuids[0].DbGuid)->mapid)
      |                                  ^~~~~~~~~~
      |                                  ObjectMgr
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:63:55: error: invalid use of incomplete type ‘const struct SpawnGroupEntry’
   63 |             if (m_map.GetId() != sObjectMgr.GetGOData(entry.DbGuids[0].DbGuid)->mapid)
      |                                                       ^~~~~
In file included from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.h:24,
                 from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:19:
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnGroup.h:29:8: note: forward declaration of ‘struct SpawnGroupEntry’
   29 | struct SpawnGroupEntry;
      |        ^~~~~~~~~~~~~~~
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:68:13: error: invalid use of incomplete type ‘const struct SpawnGroupEntry’
   68 |         if (entry.Type == SPAWN_GROUP_CREATURE)
      |             ^~~~~
In file included from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.h:24,
                 from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:19:
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnGroup.h:29:8: note: forward declaration of ‘struct SpawnGroupEntry’
   29 | struct SpawnGroupEntry;
      |        ^~~~~~~~~~~~~~~
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:68:27: error: ‘SPAWN_GROUP_CREATURE’ was not declared in this scope
   68 |         if (entry.Type == SPAWN_GROUP_CREATURE)
      |                           ^~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:72:31: error: invalid use of incomplete type ‘const struct SpawnGroupEntry’
   72 |         m_spawnGroups.emplace(entry.Id, spawnGroup);
      |                               ^~~~~
In file included from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.h:24,
                 from /home/mangos/cmangos/wotlk/src/game/Maps/SpawnManager.cpp:19:
/home/mangos/cmangos/wotlk/src/game/Maps/SpawnGroup.h:29:8: note: forward declaration of ‘struct SpawnGroupEntry’
   29 | struct SpawnGroupEntry;
      |        ^~~~~~~~~~~~~~~
make[2]: *** [src/game/CMakeFiles/game.dir/build.make:8292: src/game/CMakeFiles/game.dir/Maps/SpawnManager.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:702: src/game/CMakeFiles/game.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
adellaci commented 2 years ago

@killerwife would you like me to create another issue for this?

killerwife commented 2 years ago

Not really, just wait.

killerwife commented 2 years ago

Ok I will not lie, I just built it on ubuntu 18.04 and it built properly. I will need someone with 20.04 to actually fix this because I dont want to shoot in the dark.

adellaci commented 2 years ago

@killerwife Reopen issue. I got the same issue with Classic from tonight update. I am wiping every again and starting over. I have never had this issue before. I chopped down the compiling to one processor to see if there is an impact.

adellaci commented 2 years ago

@killerwife It finished and resulted in the same error as it did with 'WoTLK' when i started this issue;

Core SHA1 Commit Hash 8f457ec8c6b209a7063ee4fe8b0ba07a2d24929a

[ 81%] Building CXX object src/game/CMakeFiles/game.dir/Groups/GroupHandler.cpp.o
/home/mangos/cmangos/classic/src/game/Grids/GridNotifiers.cpp: In member function ‘void MaNGOS::RespawnDo::operator()(Creature*) const’:
/home/mangos/cmangos/classic/src/game/Grids/GridNotifiers.cpp:214:46: error: invalid use of incomplete type ‘class MapPersistentState’
  214 |             u->GetMap()->GetPersistentState()->SaveCreatureRespawnTime(u->GetDbGuid(), time(nullptr));
      |                                              ^~
In file included from /home/mangos/cmangos/classic/src/game/Maps/MapManager.h:25,
                 from /home/mangos/cmangos/classic/src/game/Entities/Unit.h:38,
                 from /home/mangos/cmangos/classic/src/game/Entities/DynamicObject.h:25,
                 from /home/mangos/cmangos/classic/src/game/Grids/GridNotifiers.h:26,
                 from /home/mangos/cmangos/classic/src/game/Grids/GridNotifiers.cpp:19:
/home/mangos/cmangos/classic/src/game/Maps/Map.h:53:7: note: forward declaration of ‘class MapPersistentState’
   53 | class MapPersistentState;
      |       ^~~~~~~~~~~~~~~~~~
[ 81%] Building CXX object src/game/CMakeFiles/game.dir/Groups/GroupReference.cpp.o
make[2]: *** [src/game/CMakeFiles/game.dir/build.make:3937: src/game/CMakeFiles/game.dir/Grids/GridNotifiers.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:702: src/game/CMakeFiles/game.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
adellaci commented 2 years ago

I will go on to test TBC

adellaci commented 2 years ago

Sorry it is different but pertain to some of the same files

adellaci commented 2 years ago

TBC compiled without issue

insunaa commented 2 years ago

mangos-classic compiles just fine for me on clang++ g++ does however kill itself when trying to compile it, but the issue is declared to be an internal compiler issue, so I don't think the code here is wrong.

killerwife commented 2 years ago

@adellaci post the exact versions of gcc and g++ you have

adellaci commented 2 years ago

g++ (Ubuntu 9.3.0-17ubuntu1-20.04) 9.3.0 gcc (Ubuntu 9.3.0-17ubuntu1-20.04) 9.3.0

adellaci commented 2 years ago

This is the system i have been running for cmangos. Same one since the start of Ubuntu 16.04

OS: Ubuntu 20.04.3 Server System: Dell PowerEdge 2900 Socket(s): 2 Model name: Intel(R) Xeon(R) CPU X5450 @ 3.00GH Cores: 4 / Socket Mem: 48G

killerwife commented 2 years ago

I have just compiled clean mangos-wotlk freshly pulled on ubuntu 18.04 with G++ 9.4.0 and it compiled just fine. I really dont know whats going on.

adellaci commented 2 years ago

okay let me try push my G++ to 9.4 and see if it makes a difference, but going to try a couple of other things first.

adellaci commented 2 years ago

I'm starting to think i have a system issue. Here is what i have now. Error is different

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done

-- This script builds the MaNGOS server.
  Options that can be used in order to configure the process:
    CMAKE_INSTALL_PREFIX    Path where the server should be installed to
    PCH                     Use precompiled headers
    DEBUG                   Include additional debug-code in core
    WARNINGS                Show all warnings during compile
    POSTGRESQL              Use PostgreSQL instead of mysql
    BUILD_GAME_SERVER       Build game server (core server)
    BUILD_LOGIN_SERVER      Build login server (auth server)
    BUILD_EXTRACTORS        Build map/dbc/vmap/mmap extractor
    BUILD_SCRIPTDEV         Build scriptdev. (Disable it to speedup build in dev mode by not including scripts)
    BUILD_PLAYERBOT         Build Playerbot mod
    BUILD_AHBOT             Build Auction House Bot mod
    BUILD_METRICS           Build Metrics, generate data for Grafana
    BUILD_RECASTDEMOMOD     Build map/vmap/mmap viewer
    BUILD_GIT_ID            Build git_id
    BUILD_DOCS              Build documentation with doxygen

  To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'.
  Also, you can specify the generator with -G. see 'cmake --help' for more details
  For example:
    Build server
    cmake -DCMAKE_INSTALL_PREFIX=../opt/cmangos ..

    Build full server with extractor
    cmake -DCMAKE_INSTALL_PREFIX=../opt/cmangos -DBUILD_EXTRACTORS=ON ..

    Build only server without scripts and extractors and in debug mode
    cmake -DCMAKE_INSTALL_PREFIX=../opt/cmangos -DDEBUG=ON -DBUILD_ALL_SCRIPTS=OFF ..

    Build only login server
    cmake -DCMAKE_INSTALL_PREFIX=../opt/cmangos -DBUILD_GAME_SERVER=OFF ..

-- Detected 64-bit platform
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
-- GCC: SFMT enabled, SSE2 flags forced
Defaulting to release build.
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Boost: /usr/include (found version "1.71.0") found components: system program_options thread regex serialization filesystem chrono date_time atomic 
-- Using mysql-config: /usr/bin/mysql_config
-- Found MySQL library: /usr/lib/x86_64-linux-gnu/libmysqlclient.so
-- Found MySQL headers: /usr/include/mysql
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1f")  
-- CMaNGOS-Core revision : 1872b37b10ed711a91475dcd37d1631df33bae9d
-- Revision time stamp   : "2021-12-13T19:52:25+01:00"
-- Install server to     : /home/mangos/wow-servers/wotlk
-- Use PCH               : No
-- Build in debug-mode   : No  (default)
-- Build game server     : Yes (default)
-- Build login server    : Yes (default)
-- Build ScriptDev       : Yes (default)
-- Build AHBot           : Yes
-- Build METRICs         : No  (default)
-- Build Playerbot       : Yes
-- Build extractors      : Yes
-- Build RecastDemoMod   : No  (default)
-- Build git_id          : No  (default)
-- Build documentation   : No  (default)

-- Configuring done
-- Generating done
-- Build files have been written to: /home/mangos/build/wotlk
/home/mangos/cmangos/wotlk/src/game/Entities/MiscHandler.cpp: In member function ‘void WorldSession::HandleChangePlayerDifficulty(WorldPacket&)’:
/home/mangos/cmangos/wotlk/src/game/Entities/MiscHandler.cpp:1390:31: error: invalid use of incomplete type ‘class InstanceData’
 1390 |     if (map->GetInstanceData()->IsEncounterInProgress())
      |                               ^~
In file included from /home/mangos/cmangos/wotlk/src/game/Entities/Item.h:23,
                 from /home/mangos/cmangos/wotlk/src/game/Server/WorldSession.h:31,
                 from /home/mangos/cmangos/wotlk/src/game/Server/Opcodes.h:32,
                 from /home/mangos/cmangos/wotlk/src/shared/WorldPacket.h:24,
                 from /home/mangos/cmangos/wotlk/src/game/Entities/MiscHandler.cpp:26:
/home/mangos/cmangos/wotlk/src/game/Entities/Object.h:111:7: note: forward declaration of ‘class InstanceData’
  111 | class InstanceData;
      |       ^~~~~~~~~~~~
[ 83%] Building CXX object src/game/CMakeFiles/game.dir/Entities/PetHandler.cpp.o
[ 83%] Building CXX object src/game/CMakeFiles/game.dir/Entities/PetitionsHandler.cpp.o
make[2]: *** [src/game/CMakeFiles/game.dir/build.make:7551: src/game/CMakeFiles/game.dir/Entities/MiscHandler.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:702: src/game/CMakeFiles/game.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
adellaci commented 2 years ago

-- The C compiler identification is GNU 8.4.0 -- The CXX compiler identification is GNU 8.4.0

Exact same issue. On to next

adellaci commented 2 years ago

reran a build of tbc and i did not have an issue with 'TBC', and realm & world came up fine, but with a couple of warnings.

adellaci commented 2 years ago

-- The C compiler identification is GNU 10.3.0 -- The CXX compiler identification is GNU 10.3.0

Exact same issue.

adellaci commented 2 years ago

So in conclusion I have compile issues with Classic and WoTLK, but no issue with TBC. I am going to run TBC through GCC 7, 8, 9, & 10 to see if there are any compiling differences

adellaci commented 2 years ago

I believe I grouped this correctly.

TBC Compiling; -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 Warnings: 0 Errors: 0

-- The C compiler identification is GNU 8.4.0 -- The CXX compiler identification is GNU 8.4.0 Warnings: 5 Errors: 0

/home/mangos/cmangos/tbc/src/shared/Log.cpp: In static member function ‘static std::__cxx11::string Log::GetTimestampStr()’:
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:23: warning: ‘%02d’ directive output may be truncated writing between 2 and 11 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:23: note: directive argument in the range [-2147483647, 2147483647]
In file included from /usr/include/stdio.h:867,
                 from /home/mangos/cmangos/tbc/src/shared/pchdef.h:6,
                 from /home/mangos/build/tbc/src/shared/CMakeFiles/shared.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 20 and 72 bytes into a destination of size 20
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/src/shared/Log.cpp: In member function ‘void Log::Initialize()’:
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:23: warning: ‘%02d’ directive output may be truncated writing between 2 and 11 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:23: note: directive argument in the range [-2147483647, 2147483647]
In file included from /usr/include/stdio.h:867,
                 from /home/mangos/cmangos/tbc/src/shared/pchdef.h:6,
                 from /home/mangos/build/tbc/src/shared/CMakeFiles/shared.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 20 and 72 bytes into a destination of size 20
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/src/shared/Util.cpp: In function ‘std::__cxx11::string TimeToTimestampStr(time_t)’:
/home/mangos/cmangos/tbc/src/shared/Util.cpp:255:23: warning: ‘%02d’ directive output may be truncated writing between 2 and 11 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/src/shared/Util.cpp:255:23: note: directive argument in the range [-2147483647, 2147483647]
In file included from /usr/include/stdio.h:867,
                 from /home/mangos/cmangos/tbc/src/shared/pchdef.h:6,
                 from /home/mangos/build/tbc/src/shared/CMakeFiles/shared.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 20 and 72 bytes into a destination of size 20
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp: In function ‘bool fillArchiveNameVector(std::vector<std::__cxx11::basic_string<char> >&)’:
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:388:19: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 512 [-Wformat-overflow=]
     sprintf(path, "%spatch", input_path);
                   ^~~~~~~~~  ~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/8/cstdio:42,
                 from /home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:20:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 6 and 1029 bytes into a destination of size 512
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:398:23: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 512 [-Wformat-overflow=]
         sprintf(path, "%s%s/patch-%s", input_path, i->c_str(), i->c_str());
                       ^~~~~~~~~~~~~~~  ~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/8/cstdio:42,
                 from /home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:20:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output 8 or more bytes (assuming 1031) into a destination of size 512
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp: In function ‘bool ExtractSingleWmo(std::__cxx11::string&)’:
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:214:36: warning: ‘%03d’ directive writing between 3 and 11 bytes into a region of size between 0 and 1023 [-Wformat-overflow=]
             sprintf(groupFileName, "%s_%03d.wmo", temp, i);
                                    ^~~~~~~~~~~~~
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:214:36: note: using the range [-2147483648, 2147483647] for directive argument
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/8/cstdio:42,
                 from /home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:20:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 9 and 1040 bytes into a destination of size 1024
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 Warnings: 6 Errors: 0

/home/mangos/cmangos/tbc/src/shared/Log.cpp: In static member function ‘static std::string Log::GetTimestampStr()’:
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:29: warning: ‘%02d’ directive output may be truncated writing between 2 and 11 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
  354 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                             ^~~~
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:23: note: directive argument in the range [-2147483647, 2147483647]
  354 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /home/mangos/cmangos/tbc/src/shared/pchdef.h:6,
                 from /home/mangos/build/tbc/src/shared/CMakeFiles/shared.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 20 and 72 bytes into a destination of size 20
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/src/shared/Log.cpp: In member function ‘void Log::Initialize()’:
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:29: warning: ‘%02d’ directive output may be truncated writing between 2 and 11 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
  354 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                             ^~~~
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:23: note: directive argument in the range [-2147483647, 2147483647]
  354 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /home/mangos/cmangos/tbc/src/shared/pchdef.h:6,
                 from /home/mangos/build/tbc/src/shared/CMakeFiles/shared.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 20 and 72 bytes into a destination of size 20
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/src/shared/Util.cpp: In function ‘std::string TimeToTimestampStr(time_t)’:
/home/mangos/cmangos/tbc/src/shared/Util.cpp:255:29: warning: ‘%02d’ directive output may be truncated writing between 2 and 11 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
  255 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                             ^~~~
/home/mangos/cmangos/tbc/src/shared/Util.cpp:255:23: note: directive argument in the range [-2147483647, 2147483647]
  255 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /home/mangos/cmangos/tbc/src/shared/pchdef.h:6,
                 from /home/mangos/build/tbc/src/shared/CMakeFiles/shared.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 20 and 72 bytes into a destination of size 20
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp: In function ‘bool fillArchiveNameVector(std::vector<std::__cxx11::basic_string<char> >&)’:
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:388:20: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 512 [-Wformat-overflow=]
  388 |     sprintf(path, "%spatch", input_path);
      |                    ^~        ~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:20:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 6 and 1029 bytes into a destination of size 512
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:398:24: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 512 [-Wformat-overflow=]
  398 |         sprintf(path, "%s%s/patch-%s", input_path, i->c_str(), i->c_str());
      |                        ^~              ~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:20:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output 8 or more bytes (assuming 1031) into a destination of size 512
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp: In function ‘bool ExtractSingleWmo(std::string&)’:
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:214:40: warning: ‘%03d’ directive writing between 3 and 11 bytes into a region of size between 0 and 1023 [-Wformat-overflow=]
  214 |             sprintf(groupFileName, "%s_%03d.wmo", temp, i);
      |                                        ^~~~
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:214:36: note: using the range [-2147483648, 2147483647] for directive argument
  214 |             sprintf(groupFileName, "%s_%03d.wmo", temp, i);
      |                                    ^~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:20:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 9 and 1040 bytes into a destination of size 1024
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- The C compiler identification is GNU 10.3.0 -- The CXX compiler identification is GNU 10.3.0

Warnings: 3 Errors: 0

/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp: In function ‘bool ExtractSingleWmo(std::string&)’:
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:214:40: warning: ‘%03d’ directive writing between 3 and 11 bytes into a region of size between 0 and 1023 [-Wformat-overflow=]
  214 |             sprintf(groupFileName, "%s_%03d.wmo", temp, i);
      |                                        ^~~~
/home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:214:36: note: using the range [-2147483648, 2147483647] for directive argument
  214 |             sprintf(groupFileName, "%s_%03d.wmo", temp, i);
      |                                    ^~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/10/cstdio:42,
                 from /home/mangos/cmangos/tbc/contrib/vmap_extractor/vmapextract/vmapexport.cpp:20:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 9 and 1040 bytes into a destination of size 1024
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/src/shared/Log.cpp: In static member function ‘static std::string Log::GetTimestampStr()’:
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:29: warning: ‘%02d’ directive output may be truncated writing between 2 and 11 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
  354 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                             ^~~~
/home/mangos/cmangos/tbc/src/shared/Log.cpp:354:23: note: directive argument in the range [-2147483647, 2147483647]
  354 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /home/mangos/cmangos/tbc/src/shared/pchdef.h:6,
                 from /home/mangos/build/tbc/src/shared/CMakeFiles/shared.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 20 and 72 bytes into a destination of size 20
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mangos/cmangos/tbc/src/shared/Util.cpp: In function ‘std::string TimeToTimestampStr(time_t)’:
/home/mangos/cmangos/tbc/src/shared/Util.cpp:255:29: warning: ‘%02d’ directive output may be truncated writing between 2 and 11 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
  255 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                             ^~~~
/home/mangos/cmangos/tbc/src/shared/Util.cpp:255:23: note: directive argument in the range [-2147483647, 2147483647]
  255 |     snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year + 1900, aTm->tm_mon + 1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /home/mangos/cmangos/tbc/src/shared/pchdef.h:6,
                 from /home/mangos/build/tbc/src/shared/CMakeFiles/shared.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 20 and 72 bytes into a destination of size 20
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
adellaci commented 2 years ago

Would it be worth me running Classic & WoTLK through the same process? Would anything be gained by it?

adellaci commented 2 years ago

@killerwife I have not figure out how to resolve. Stripping done the server today and start from scratch.

insunaa commented 2 years ago

I recommend completely deleting the mangos-wotlk directory and starting fresh, yep.

For some reason the preprocessor doesn't seem to want to include some headerfiles for you. This could be filesystem permission problems for example or several other things.

One note about installing cmangos on linux: you almost never have to use sudo or run commands as the root user. Almost everything can be done without a privileged user, including compiling. If you happened to use sudo inconsistently during setup, you might have created a permission conflict, so deleting and starting over should be the best course of action.

adellaci commented 2 years ago

Okay wiped server disks, started fresh. Install Ubuntu 20.04.3 Server. Created user 'mangos'. Clone fresh, classic, TBC, wotlk with user mangos, no sudo. Still have the same compile errors and warning for 'classic' & 'wotlk'. No compile errors for 'TBC'.

adellaci commented 2 years ago

Is anyone else using Ubuntu 20.04.3?

insunaa commented 2 years ago

You have installed all the dependencies listed here tho, right? https://github.com/cmangos/issues/wiki/Installation-Instructions

Can you upload your entire src/game/Grids/GridNotifiers.cpp to a github gist?

adellaci commented 2 years ago

I copied/pasted all the install dependences.

You talking about opening in a text editor and pasting it?

insunaa commented 2 years ago

https://gist.github.com/

open it in a text editor and paste it on that site and post the link here. I just want to know if there's some reason you might be downloading an outdated version of that file. If I can see the file you have it'll be self-evident if you have the correct version or not.

cyberium commented 2 years ago

osboxes@osboxes:~/cmangos/mangos-wotlk$ cmake -H. -Bbin/build
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done

-- This script builds the MaNGOS server.
  Options that can be used in order to configure the process:
    CMAKE_INSTALL_PREFIX    Path where the server should be installed to
    PCH                     Use precompiled headers
    DEBUG                   Include additional debug-code in core
    WARNINGS                Show all warnings during compile
    POSTGRESQL              Use PostgreSQL instead of mysql
    BUILD_GAME_SERVER       Build game server (core server)
    BUILD_LOGIN_SERVER      Build login server (auth server)
    BUILD_EXTRACTORS        Build map/dbc/vmap/mmap extractor
    BUILD_SCRIPTDEV         Build scriptdev. (Disable it to speedup build in dev mode by not including scripts)
    BUILD_PLAYERBOT         Build Playerbot mod
    BUILD_AHBOT             Build Auction House Bot mod
    BUILD_METRICS           Build Metrics, generate data for Grafana
    BUILD_RECASTDEMOMOD     Build map/vmap/mmap viewer
    BUILD_GIT_ID            Build git_id
    BUILD_DOCS              Build documentation with doxygen

  To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'.
  Also, you can specify the generator with -G. see 'cmake --help' for more details
  For example:
    Build server
    cmake -DCMAKE_INSTALL_PREFIX=../opt/cmangos ..

    Build full server with extractor
    cmake -DCMAKE_INSTALL_PREFIX=../opt/cmangos -DBUILD_EXTRACTORS=ON ..

    Build only server without scripts and extractors and in debug mode
    cmake -DCMAKE_INSTALL_PREFIX=../opt/cmangos -DDEBUG=ON -DBUILD_ALL_SCRIPTS=OFF ..

    Build only login server
    cmake -DCMAKE_INSTALL_PREFIX=../opt/cmangos -DBUILD_GAME_SERVER=OFF ..

-- Detected 64-bit platform
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
-- GCC: SFMT enabled, SSE2 flags forced
Defaulting to release build.
-- Found Git: /usr/bin/git (found version "2.25.1")
-- cotire 1.7.6 loaded.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Boost: /usr/include (found version "1.71.0") found components: system program_options thread regex serialization filesystem chrono date_time atomic
-- Using mysql-config: /usr/bin/mysql_config
-- Found MySQL library: /usr/lib/x86_64-linux-gnu/libmysqlclient.so
-- Found MySQL headers: /usr/include/mysql
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1f")
-- CMaNGOS-Core revision : 9fcab5cd65698abe524fe5c80707b4bda338be88
-- Revision time stamp   : "2021-12-20T17:15:00+01:00"
-- Install server to     : /usr/local
-- Use PCH               : Yes (default)
-- Build in debug-mode   : No  (default)
-- Build game server     : Yes (default)
-- Build login server    : Yes (default)
-- Build ScriptDev       : Yes (default)
-- Build AHBot           : No  (default)
-- Build METRICs         : No  (default)
-- Build Playerbot       : No  (default)
-- Build extractors      : No  (default)
-- Build RecastDemoMod   : No  (default)
-- Build git_id          : No  (default)
-- Build documentation   : No  (default)

-- Configuring done
-- Generating done
-- Build files have been written to: /home/osboxes/cmangos/mangos-wotlk/bin/build

...

Iam not able to reproduce your error

cyberium commented 2 years ago

can you try to add #include "Maps/MapPersistentStateMgr.h" in top of the GridNotifiers.cpp file and see if it help for building?

like

insunaa commented 2 years ago

That include should already be present in the latest version of GridNotifiers.cpp

cala commented 2 years ago

I have the same issue on my mac OS installation for Classic and TBC cores (did not test WotLK yet).

It seems the compiler does not include all the headers in the same/correct order, resulting in classes being accessed before being declared (access to incomplete type).

I've already fixed the issue with GridNotifiers.cpp only to see a similar one pops up in its stead.

I think I will open a PR with all the fixes as I come up with them.

insunaa commented 2 years ago

Seems like a non-deterministic error then... Very strange

adellaci commented 2 years ago

I will upload current file and then do @cyberium suggestion and post results. I will be home in an hours and go that it

cala commented 2 years ago

Slowly going through this in https://github.com/cmangos/mangos-classic/pull/456

adellaci commented 2 years ago

@cala I test as soon as I get home for classic. Compilers 7 thru 10

cala commented 2 years ago

Hmm. After fixing some missing headers, I've reached an error that I'm not sure how to fix:

[ 19%] Building CXX object src/game/CMakeFiles/game.dir/vmap/BIH.cpp.o
[ 19%] Building CXX object src/game/CMakeFiles/game.dir/vmap/DynamicTree.cpp.o
In file included from /Users/nicolas/dev/GitHub/cmangos-classic/src/game/World/WorldStateVariableManager.cpp:19:
/Users/dev/GitHub/cmangos-classic/src/game/World/WorldStateVariableManager.h:36:40: error: implicit instantiation of undefined template 'std::__1::vector<std::__1::function<void ()>, std::__1::allocator<std::__1::function<void ()> > >'
    std::vector<std::function<void()>> executors;
                                       ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/iosfwd:200:28: note: template is declared here
class _LIBCPP_TEMPLATE_VIS vector;
                           ^
[ 19%] Building CXX object src/game/CMakeFiles/game.dir/vmap/GameObjectModel.cpp.o
[ 20%] Building CXX object src/game/CMakeFiles/game.dir/vmap/MapTree.cpp.o

It seems that a template definition is expected for the following structure declaration in WorldStateVariableManager.h

struct WorldStateVariable
{
    int32 value;
    bool send;
    uint32 zoneId;
    uint32 areaId;
    std::vector<std::function<void()>> executors;

    WorldStateVariable() : value(0), send(false), zoneId(0), areaId(0) {}
};
cyberium commented 2 years ago

Try include <functional>

insunaa commented 2 years ago

what's even weirder: things compile just fine for me, but after having run GridNotifiers.cpp in mangos-tbc through the preprocessor, manually setting all include directories, I also get the Member access into incomplete type error

what a weird bug...

https://gist.github.com/insunaa/a3868977128b3ca27fc5fc9a92863785 <= the completely preprocessed gridnotifiers.cpp file (it has 239734 lines tho, so probably not very easy to search through :D )

cala commented 2 years ago

Try include <functional>

@cyberium It's already included:

#include "Platform/Define.h"
#include <map>
#include <functional>
#include <string>

😢

cyberium commented 2 years ago

Then maybe its <vector> :D

because i see nothing wrong on that line Even if its maybe not so usual to store function pointer in vector

cala commented 2 years ago

Then maybe its <vector> :D

It was. 😄 Build completed with the commits in the PR I've opened.

cala commented 2 years ago

@adellaci Could you test the commits in https://github.com/cmangos/mangos-classic/pull/456 ? If they work for you, I'll merge it in core and port to the two others.

insunaa commented 2 years ago

Tho now that I think about it, cmangos-tbc doesn't compile for me on gcc at all, only with clang++ To be fair, I use a very recent gcc version: 11.1.0

found the culprit: https://github.com/gcc-mirror/gcc/commit/e41ba804ba5f5ca433e09238d561b1b4c8b10985 nvm, possibly found the developer and contacted them via e-mail. let's hope that helps with something

during GIMPLE pass: vrp
/home/name/git/mangos-tbc/src/game/vmap/TileAssembler.cpp: In member function ‘void VMAP::TileAssembler::exportGameobjectModels()’:
/home/name/git/mangos-tbc/src/game/vmap/TileAssembler.cpp:334:10: internal compiler error: in compute_live_loop_exits, at tree-ssa-loop-manip.c:247
  334 |     void TileAssembler::exportGameobjectModels()
      |          ^~~~~~~~~~~~~
0x1797368 internal_error(char const*, ...)
        ???:0
0x67f8f9 fancy_abort(char const*, int, char const*)
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.archlinux.org/> for instructions.
make[2]: *** [src/game/CMakeFiles/game.dir/build.make:9117: src/game/CMakeFiles/game.dir/vmap/TileAssembler.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:462: src/game/CMakeFiles/game.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
adellaci commented 2 years ago

Did 'git pull' for classic commit hash 8a2064fcaa8c666e63a9f84dfb93928ac6ab6498 gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0 g++ (Ubuntu 7.5.0-6ubuntu2) 7.5.0

using: cmake ~/cmangos/classic -DCMAKE_INSTALL_PREFIX=~/wow-servers/classic -DBUILD_EXTRACTORS=ON -DBUILD_AHBOT=ON -DBUILD_PLAYERBOT=ON -DPCH=0 -DDEBUG=0 -DBUILD_RECASTDEMOMOD=OFF ; make -j6

warnings: 1

/home/mangos/cmangos/classic/src/game/Anticheat/module/Warden/wardenwin.cpp: In lambda function:
/home/mangos/cmangos/classic/src/game/Anticheat/module/Warden/wardenwin.cpp:619:42: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
                 Required, Prohibited, val);
                                          ^
/home/mangos/cmangos/classic/src/game/Anticheat/module/Warden/wardenwin.cpp:619:42: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
/home/mangos/cmangos/classic/src/game/Anticheat/module/Warden/wardenwin.cpp:619:42: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘unsigned int’ [-Wformat=]

errors: 2

/home/mangos/cmangos/classic/src/game/Grids/GridNotifiers.cpp: In member function ‘void MaNGOS::RespawnDo::operator()(Creature*) const’:
/home/mangos/cmangos/classic/src/game/Grids/GridNotifiers.cpp:214:46: error: invalid use of incomplete type ‘class MapPersistentState’
             u->GetMap()->GetPersistentState()->SaveCreatureRespawnTime(u->GetDbGuid(), time(nullptr));
                                              ^~
In file included from /home/mangos/cmangos/classic/src/game/Maps/MapManager.h:25:0,
                 from /home/mangos/cmangos/classic/src/game/Entities/Unit.h:38,
                 from /home/mangos/cmangos/classic/src/game/Entities/DynamicObject.h:25,
                 from /home/mangos/cmangos/classic/src/game/Grids/GridNotifiers.h:26,
                 from /home/mangos/cmangos/classic/src/game/Grids/GridNotifiers.cpp:19:
/home/mangos/cmangos/classic/src/game/Maps/Map.h:53:7: note: forward declaration of ‘class MapPersistentState’
 class MapPersistentState;
       ^~~~~~~~~~~~~~~~~~
[ 72%] Building CXX object src/game/CMakeFiles/game.dir/Groups/GroupReference.cpp.o
make[2]: *** [src/game/CMakeFiles/game.dir/build.make:3924: src/game/CMakeFiles/game.dir/Grids/GridNotifiers.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:702: src/game/CMakeFiles/game.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
cala commented 2 years ago

@adellaci did you pull all commits from the PR ? Including https://github.com/cmangos/mangos-classic/pull/456/commits/b4c7ba7184da3e4dd63a93d10962e17c0069a94e ? Because the error above should be fixed by the inclusion of the header from that commit.

adellaci commented 2 years ago

@cala unware how to pull PR