Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error on VS2022 #10806

Closed
asfo opened this issue Feb 24, 2022 · 11 comments
Closed

Compilation error on VS2022 #10806

asfo opened this issue Feb 24, 2022 · 11 comments
Assignees

Comments

@asfo
Copy link
Contributor

asfo commented Feb 24, 2022

Current Behaviour

There is an error that on VS2022 that does not let AC to compile on the fmt library:

"fmt_udl.cc", line 18: error: a literal operator template must have a template
          parameter list equivalent to '<char ...>'
  constexpr auto operator""_a() -> int {

Expected Blizzlike Behaviour

N/A

Source

The error is in the following line:

# if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS

Steps to reproduce the problem

  1. Try to compile on VS2022
  2. Profit(??

Extra Notes

This is NOT an issue with the fmt library itself OR with AzerothCore but with the IDE, so I think it's a good idea to support VS2022 too until Microsoft fixes this.

There is a possible fix by replacing all

#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS

With

#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS && !defined(__INTELLISENSE__)

AC rev. hash/commit

N/A

Operating system

Windows 11

Custom changes or Modules

No response

@asfo asfo changed the title Compilation error on VS2022 [includes fix] Compilation error on VS2022 Feb 24, 2022
@Kitzunu
Copy link
Member

Kitzunu commented Feb 24, 2022

@Winfidonarleyan

@Winfidonarleyan
Copy link
Member

Need cmake logs

@asfo
Copy link
Contributor Author

asfo commented Feb 25, 2022

Need cmake logs

There you go...

CMake version: 3.22.2
> Warning: module using deprecated add config file api
-- REWARD SYSTEM CONFIGURED --
> Warning: module using deprecated add config file api
-- PROFESSION NPC CONFIGURED --
> Warning: module using deprecated add config file api
> Warning: module using deprecated add config file api
> Warning: module using deprecated add config file api
-- Chat Word Blocker Configured --
> Warning: module using deprecated add config file api
> Warning: module using deprecated add config file api
> Warning: module using deprecated add config file api
Running cmake hook: AFTER_LOAD_CONF
No hooks registered for AFTER_LOAD_CONF
Enabled С++20 standard
Detected 64-bit platform
MSVC: Minimum version required is 19.24, found 19.31.31104.0 - ok!
MSVC: 64-bit platform, enforced -D_WIN64 parameter
MSVC: Enabled extended object-support for debug-compiles
MSVC: Overloaded standard names
MSVC: Disabled NON-SECURE warnings
MSVC: Disabled POSIX warnings
MSVC: Disabled INTMAX_MAX warnings
MSVC: Enable NOMINMAX
MSVC: Disabled generic compiletime warnings
Using installation path for configuration files
Running cmake hook: AFTER_LOAD_CMAKE_MODULES
No hooks registered for AFTER_LOAD_CMAKE_MODULES
Found MySQL library: C:/Program Files/MySQL/MySQL Server 8.0/lib/libmysql.lib
Found MySQL headers: C:/Program Files/MySQL/MySQL Server 8.0/include
Found MySQL executable: C:/Program Files/MySQL/MySQL Server 8.0/bin/mysql.exe
Found git binary : C:/Program Files/Git/cmd/git.exe

* AzerothCore revision            : 17ee64574b7d 2022-02-24 14:20:26 -0600 (main branch)

* Install core to                 : C:/Program Files (x86)/AzerothCore
* Install configs to              : C:/Program Files (x86)/AzerothCore

* Build world/auth                : Yes (default)
* Build with scripts              : Yes (static)
* Build with modules              : Yes (static)
* Build map/vmap tools            : No  (default)
* Build unit tests                : No  (default)
* Build core w/PCH                : Yes (default)
* Build scripts w/PCH             : Yes (default)
* Show compile-warnings           : No  (default)
* Use coreside debug              : No  (default)
* Use MySQL sourcetree            : No
* Use GIT revision hash           : Yes (default)
* Enable vmap DisableMgr checks   : No
* Show source tree                : Yes - "hierarchical"

Running cmake hook: BEFORE_SRC_LOAD
No hooks registered for BEFORE_SRC_LOAD
Running cmake hook: AFTER_AUTHSERVER_CMAKE
No hooks registered for AFTER_AUTHSERVER_CMAKE
Running cmake hook: BEFORE_GAME_LIBRARY
No hooks registered for BEFORE_GAME_LIBRARY
Running cmake hook: AFTER_GAME_LIBRARY
No hooks registered for AFTER_GAME_LIBRARY
Running cmake hook: BEFORE_SCRIPTS_LIBRARY
No hooks registered for BEFORE_SCRIPTS_LIBRARY

* Script configuration (static):
  |
  +- worldserver
  |   +- Commands
  |   +- Custom
  |   +- EasternKingdoms
  |   +- Events
  |   +- Kalimdor
  |   +- Northrend
  |   +- OutdoorPvP
  |   +- Outland
  |   +- Pet
  |   +- Spells
  |   +- World
  |


Running cmake hook: AFTER_WORLDSERVER_CMAKE
No hooks registered for AFTER_WORLDSERVER_CMAKE

* Modules configuration (static):
  |
  +- worldserver
  |   +- mod-1v1-arena
  |   +- mod-TimeIsTime
  |   +- mod-ah-bot
  |   +- mod-autobalance
  |   +- mod-battle-royal
  |   +- mod-boss-announcer
  |   +- mod-buff-command
  |   +- mod-censorship
  |   +- mod-cfbg
  |   +- mod-duel-reset
  |   +- mod-eluna-lua-engine
  |   +- mod-fireworks-on-level
  |   +- mod-learn-spells
  |   +- mod-low-level-arena
  |   +- mod-morph-all-players
  |   +- mod-new-character-perks
  |   +- mod-npc-free-professions
  |   +- mod-npc-spectator
  |   +- mod-pvp-titles
  |   +- mod-pvpstats-announcer
  |   +- mod-recruit-friend
  |   +- mod-reward-played-time
  |   +- mod-transmog
  |   +- mod-weekend-xp
  |   +- mod-world-chat
  |

> Module (mod-TimeIsTime) using deprecated loader api
> Module (mod-battle-royal) using deprecated loader api
> Module (mod-buff-command) using deprecated loader api
> Module (mod-censorship) using deprecated loader api
> Module (mod-morph-all-players) using deprecated loader api
> Module (mod-new-character-perks) using deprecated loader api
> Module (mod-npc-free-professions) using deprecated loader api
> Module (mod-npc-spectator) using deprecated loader api
> Module (mod-pvp-titles) using deprecated loader api
> Module (mod-recruit-friend) using deprecated loader api
> Module (mod-reward-played-time) using deprecated loader api
* Modules config list:
  |
  +- mod-1v1-arena
  |  * 1v1arena.conf.dist
  +- mod-TimeIsTime
  |  * mod-time_is_time.conf.dist
  +- mod-ah-bot
  |  * mod_ahbot.conf.dist
  +- mod-autobalance
  |  * AutoBalance.conf.dist
  +- mod-battle-royal
  |  * battle_royale.conf.dist
  +- mod-boss-announcer
  |  * mod_boss_announcer.conf.dist
  +- mod-buff-command
  |  * BuffCommand.conf.dist
  +- mod-censorship
  |  * Censorship.conf.dist
  +- mod-cfbg
  |  * CFBG.conf.dist
  +- mod-duel-reset
  |  * duelreset.conf.dist
  +- mod-eluna-lua-engine
  |  * mod_LuaEngine.conf.dist
  +- mod-fireworks-on-level
  |  * mod_customserver.conf.dist
  +- mod-learn-spells
  |  * mod_learnspells.conf.dist
  +- mod-low-level-arena
  |  * LowLevelArena.conf.dist
  +- mod-morph-all-players
  |  * morph_all.conf.dist
  +- mod-new-character-perks
  |  * mod_customlogin.conf.dist
  +- mod-npc-free-professions
  +- mod-npc-spectator
  +- mod-pvp-titles
  |  * mod_pvptitles.conf.dist
  +- mod-pvpstats-announcer
  |  * pvpstats-announcer.conf.dist
  +- mod-recruit-friend
  |  * mod_recruit_friend.conf.dist
  +- mod-reward-played-time
  |  * reward_system.conf.dist
  +- mod-transmog
  |  * transmog.conf.dist
  +- mod-weekend-xp
  |  * mod-double-xp-weekend.conf.dist
  +- mod-world-chat
  |  * WorldChat.conf.dist

Running cmake hook: AFTER_SRC_LOAD
No hooks registered for AFTER_SRC_LOAD
Configuring done

@asfo
Copy link
Contributor Author

asfo commented Feb 25, 2022

As extra, after the proposed fix, the compilation works using the CMake settings above.

@Kitzunu
Copy link
Member

Kitzunu commented Feb 25, 2022

========== Build: 18 succeeded, 0 failed, 1 up-to-date, 1 skipped ==========

VS22

@Kitzunu
Copy link
Member

Kitzunu commented Feb 25, 2022

what is your VS version?

Microsoft Visual Studio Community 2022 (64-bit)
Version 17.0.5

@asfo
Copy link
Contributor Author

asfo commented Feb 25, 2022

what is your VS version?

Microsoft Visual Studio Community 2022 (64-bit)
Version 17.0.5

Weird 🤔 I did a fresh install from 0 on everything:

Microsoft Visual Studio Community 2022 (64 bits) - Current
Versión 17.1.0

And I read in the official fmt repo that is an issue with this version and Microsoft should fix it.

Here is the issue:
fmtlib/fmt#2536

@Winfidonarleyan
Copy link
Member

I use and no problem

Microsoft Visual Studio Community 2022 (64-разрядная версия) - Preview
Версия 17.2.0 Preview 1.0

@asfo
Copy link
Contributor Author

asfo commented Feb 25, 2022

I use and no problem

Microsoft Visual Studio Community 2022 (64-разрядная версия) - Preview
Версия 17.2.0 Preview 1.0

I see it's on IntelliSense on compilation inside VS2022 only:

Here is what I have selected 🤦
image

There could be an option to add this to the guide, I didn't know that VS2022 select this by default (or not by default maybe but in my case did it, as said, it's a fresh install and I followed the requirements from AC at the moment). Sorry guys, not sure if we should close this issue or maybe add the guide to move out of this, but at least I leave the reference in case someone is having this issue also :)

@Kitzunu
Copy link
Member

Kitzunu commented Feb 25, 2022

Interesting, I do not have that option. I dont even know where to find it

@asfo
Copy link
Contributor Author

asfo commented Feb 28, 2022

Interesting, I do not have that option. I don't even know where to find it

I will set this issue as closed :) but hope if someone sees the same error as me, this issue can help them to fix it.

Thanks all for the help!

@asfo asfo closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants