C2766 explicit specialization; 'std::hash<wxString>'

Hi all!

EDIT: This is a Windows build, using Visual Studio.

I’m trying to compile 2.2.2 with ASIO (no, we’re not going to get into a long, lengthy discussion of WHY. It’s a thing that’s happening.) :smiley:

Anyhoo, The compile seems to come to a screeching halt on MemoryX.h

I get:

Severity Code Description Project File Line Suppression State
Error C2766 explicit specialization; ‘std::hash’ has already been defined Audacity c:\projects\audacity-audacity-2.2.2\src\MemoryX.h 1182

Which would seem to indicate that, indeed, there’s already a wxString called hash somewhere else.

My question?

What do I do to work around this error?

I’m not familiar enough with 2.2.2 source to chase it down quickly, and time’s the one thing I’m a bit short on. Thanks!

Much appreciation, in advance.



FURTHER INFO:

CMD line compile yields this gem:

c:\projects\audacity-audacity-2.2.2\src\MemoryX.h(1182): error C2766: explicit specialization; ‘std::hash’ ha
s already been defined [C:\projects\audacity-Audacity-2.2.2\win\Projects\Audacity\Audacity.vcxproj]
C:\Users\redacted\git\wxWidgets\wxWidgets\include\wx/string.h(3986) : see previous definition of 'hash

It’s been too long since I built 2.2.2 to recall details, but a few tips:

  1. Follow all of the instruction in the the Windows build.txt file exactly.

  2. Ensure that you use the version of MSVC specified in the build.txt

  3. Ensure that you use the version of WxWidgets specified in the build.txt

  4. Ensure that the environmental variable for wx is actually set - reboot and check again. (I recall that this caused me major problems due to a bug in Windows - Windows said it was set, then after rebooting it wasn’t set :imp: )

  5. After building / installing WxWidgets, reboot the computer and then build one of the example apps to check that wx is correctly installed and working.

  6. Make a normal build first. Once that works correctly, the ASIO build should be straightforward.

  7. If it fails, clean everything and start again from the beginning.


    Sorry I can’t be more helpful, but the current build system has changed quite a lot since 2.2.2.