Skip to content

Will not compile in linux #5

@LordPsyan

Description

@LordPsyan

Unfortunately, this works fine in windows (as far as compiling. playerbots don't quite work right where randombots work fine) but will not compile in debian. It errors on things it should not error on. Here is an example when compiling in debian without tests or immersive...

root@realmsofwarcraft:/opt/mangosbot2/build# make
[ 2%] Built target detour
[ 2%] Built target gsoap
[ 8%] Built target g3dlite
[ 8%] Built target framework
[ 12%] Built target shared
Scanning dependencies of target Bots
[ 12%] Building CXX object src/modules/Bots/CMakeFiles/Bots.dir/playerbot/GuildTaskMgr.cpp.o
warning: unknown warning option '-Wno-undefined-var-template'; did you mean
'-Wno-undefined-internal'? [-Wunknown-warning-option]
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:50:18: error: no
member named 'IsFriendlyTo' in 'Player'; did you mean 'IsFriend'?
if (!player->IsFriendlyTo(guildMaster))
^~~~~~~~~~~~
IsFriend
/opt/mangosbot2/src/game/Entities/Unit.h:1440:14: note: 'IsFriend' declared here
bool IsFriend(Unit const* unit) const override;
^
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:59:4: error: cannot
pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
guild->GetName(), player->GetName(), reason);
^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:59:4: note: did you
mean to call the c_str() method?
guild->GetName(), player->GetName(), reason);
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:63:58: error:
cannot pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
sLog.outDebug("%s: guild task update for player %s", guild->GetName(), p...
~~ ^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:63:58: note: did you
mean to call the c_str() method?
...guild task update for player %s", guild->GetName(), player->GetName());
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:84:5: error: cannot
pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
guild->GetName(), player->GetName());
^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:84:5: note: did you
mean to call the c_str() method?
guild->GetName(), player->GetName());
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:93:5: error: cannot
pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
guild->GetName(), player->GetName(),
^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:93:5: note: did you
mean to call the c_str() method?
guild->GetName(), player->GetName(),
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:102:5: error:
cannot pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
guild->GetName(), player->GetName());
^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:102:5: note: did you
mean to call the c_str() method?
guild->GetName(), player->GetName());
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:111:6: error:
cannot pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
guild->GetName(), player->GetName());
^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:111:6: note: did you
mean to call the c_str() method?
guild->GetName(), player->GetName());
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:119:5: error:
cannot pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
guild->GetName(), player->GetName());
^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:119:5: note: did you
mean to call the c_str() method?
guild->GetName(), player->GetName());
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:128:6: error:
cannot pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
guild->GetName(), player->GetName());
^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:128:6: note: did you
mean to call the c_str() method?
guild->GetName(), player->GetName());
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:136:5: error:
cannot pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
guild->GetName(), player->GetName());
^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:136:5: note: did you
mean to call the c_str() method?
guild->GetName(), player->GetName());
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:145:6: error:
cannot pass non-trivial object of type 'const std::string' (aka 'const
basic_string') to variadic method; expected type from format string
was 'char *' [-Wnon-pod-varargs]
guild->GetName(), player->GetName());
^~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:145:6: note: did you
mean to call the c_str() method?
guild->GetName(), player->GetName());
^
.c_str()
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:932:67: warning:
format string is not a string literal (potentially insecure)
[-Wformat-security]
...ChatHandler(member->GetSession()).PSendSysMessage(out.str().c_str());
^~~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:939:72: warning:
format string is not a string literal (potentially insecure)
[-Wformat-security]
...out.str().c_str());
^~~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:943:55: warning:
format string is not a string literal (potentially insecure)
[-Wformat-security]
ChatHandler(player->GetSession()).PSendSysMessage(self.str().c_str());
^~~~~~~~~~~~~~~~~~
/opt/mangosbot2/src/modules/Bots/playerbot/GuildTaskMgr.cpp:1054:32: warning:
format string is not a string literal (potentially insecure)
[-Wformat-security]
CharacterDatabase.PExecute(sql.str().c_str());
^~~~~~~~~~~~~~~~~
5 warnings and 11 errors generated.
src/modules/Bots/CMakeFiles/Bots.dir/build.make:185: recipe for target 'src/modules/Bots/CMakeFiles/Bots.dir/playerbot/GuildTaskMgr.cpp.o' failed
make[2]: *** [src/modules/Bots/CMakeFiles/Bots.dir/playerbot/GuildTaskMgr.cpp.o] Error 1
CMakeFiles/Makefile2:819: recipe for target 'src/modules/Bots/CMakeFiles/Bots.dir/all' failed
make[1]: *** [src/modules/Bots/CMakeFiles/Bots.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
root@realmsofwarcraft:/opt/mangosbot2/build#

There are also many warnings. When I fix the errors with c_str() etc eventually it will error with problems in util.h which isn't modified at all...

This is for mangos-zero-ai (default branch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions