英文:
AzerothCore (ZhengPeiRu21) Playerbots module not compiling correctly
问题
我一直在尝试编译 ZhengPeiRu21 的 playerbot 模块(https://github.com/ZhengPeiRu21/mod-playerbots),但未成功。我使用了 azerothcore 中的正确代码树,就像在 readme.md 中描述的那样:https://github.com/ZhengPeiRu21/azerothcore-wotlk/tree/Playerbot
Cmake 过程没有问题,但当我运行编译时,出现了很多关于 playerbot 模块的错误。
以下是一些示例:
22>C:\...\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\ChatFilter.cpp(166,47): error C2039: 'GetTargetIcon': is not a member of 'Group'
22>C:\...\AC\pb\azerothcore-wotlk\src\server\game\Entities\Player\Player.h(59,7): message : see declaration of 'Group'
22>PlayerbotAI.cpp
22>C:\...\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\RandomItemMgr.h(20,6): warning C5257: 'EquipmentSlots': enumeration was previously declared without a fixed underlying type (compiling source file C:\Users\Jvandeneeckhout\Downloads\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\GuildTaskMgr.cpp)
22>C:\...\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\GuildTaskMgr.cpp(504,5): error C2065: 'PlayerbotsDatabasePreparedStatement': undeclared identifier
22>C:\...\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\GuildTaskMgr.cpp(504,42): error C2065: 'stmt': undeclared identifier
(部分路径已被替换为 '...' 以提高可读性)
C2065 是最常见的错误,但其他错误也存在。
如果有需要,完整的输出文件可以提供。
我认为我可能遗漏了一些关键步骤,这些步骤没有在任何地方描述,但我似乎找不到它。
我的第一个想法是在模块创建方面出错,但我能够:
- 编译并运行核心,不使用模块,没有问题。
- 编译并运行核心,编译其他模块,也没有问题。
如果有任何帮助,将不胜感激。
- git clone https://github.com/ZhengPeiRu21/azerothcore-wotlk.git
- 移动到已下载代码的 modules 文件夹:
- git clone https://github.com/ZhengPeiRu21/mod-playerbots.git
- 运行 Cmake
- 单击配置(configure)
- 将 TOOLS-BUILD 设置为 all
- 将 MODULE-MOD-PLAYERBOTS 设置为 static
- 再次单击配置(没有错误)
- 单击生成(generate)
- 单击打开项目(open project)
- VS 2022 打开了该项目
- 将项目设置为 RelWithDebInfo 和 X64
- 右键单击 BUILD-ALL > 清除(clean)
- 右键单击 BUILD-ALL > 编译(Build)
期望结果:无错误的编译
结果:带有错误的编译
英文:
I have been trying to get the ZhengPeiRu21 playerbot module (https://github.com/ZhengPeiRu21/mod-playerbots) to compile without success. I use the correct tree of azerothcore as described in the readme.md for this: https://github.com/ZhengPeiRu21/azerothcore-wotlk/tree/Playerbot
The Cmake process runs without issues, but when I run my compilation I a lot of errors on the playerbot module.
some examples:
22>C:\...\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\ChatFilter.cpp(166,47): error C2039: 'GetTargetIcon': is not a member of 'Group'
22>C:\...\AC\pb\azerothcore-wotlk\src\server\game\Entities\Player\Player.h(59,7): message : see declaration of 'Group'
22>PlayerbotAI.cpp
22>C:\...\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\RandomItemMgr.h(20,6): warning C5257: 'EquipmentSlots': enumeration was previously declared without a fixed underlying type (compiling source file C:\Users\Jvandeneeckhout\Downloads\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\GuildTaskMgr.cpp)
22>C:\...\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\GuildTaskMgr.cpp(504,5): error C2065: 'PlayerbotsDatabasePreparedStatement': undeclared identifier
22>C:\...\AC\pb\azerothcore-wotlk\modules\mod-playerbots\src\GuildTaskMgr.cpp(504,42): error C2065: 'stmt': undeclared identifier
(part of the path has been replaced by '...' for readability)
The C2065 is the most occurring but other errors are also present.
The full output file can be made available if this would be helpfull.
I think I'm missing some vital step that is not described anywhere but cannot seem to find it.
My first thought was making a mistake in how modules are created but I was able to:
- Compile and run the core without modules without issues.
- Compile and run the core with compiles other modules without issues.
Any assistance would be greatly appreciated.
- git clone https://github.com/ZhengPeiRu21/azerothcore-wotlk.git
- move to the modules folder of the downloaded code:
- git clone https://github.com/ZhengPeiRu21/mod-playerbots.git
- Run Cmake
- click configure
- set TOOLS-BUILD to all
- set MODULE-MOD-PLAYERBOTS to static
- click configure again (no errors)
- click generate
- click open project
- VS 2022 opens on the project
- set project to RelWithDebInfo and X64
- right click BUILD-ALL > clean
- right click BUILD-ALL > Build
expect: compilation without errors
Result: compilation with errors
答案1
得分: 1
You pull wrong branch for "azerothcore-wotlk"... When you clone git you need choose playerbot branch not master.
Use git clone https://github.com/ZhengPeiRu21/azerothcore-wotlk.git --branch Playerbot --single-branch
英文:
You pull wrong branch for "azerothcore-wotlk"... When you clone git you need choose playerbot branch not master.
Use git clone https://github.com/ZhengPeiRu21/azerothcore-wotlk.git --branch Playerbot --single-branch
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论