vegastrike / Vega-Strike-Engine-Source

Vega Strike Engine
Other
256 stars 42 forks source link

Compile error using VS 2022 (Windows 11) due to hash_compare (+ solution) #827

Open GZouw opened 8 months ago

GZouw commented 8 months ago

Hi,

I had a compile error with Visual Studio 2022 (Windows 11), following the instructions in readme.md. The error is: error C2039: 'hash_compare': is not a member of 'std'

I traced the issue back to https://developercommunity.visualstudio.com/t/stdext::hash_compare-has-been-removed-in/10182319

The issue can be fixed by adding -D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS

as a compiler flag according to the link above.

After doing this, compilation was successfull.

I do not know I solved this the proper way, but I hope this helps.

BR

Gerbrand

BenjamenMeyer commented 8 months ago

@GZouw thank for filing an issue. hash_compare is a method we add - see https://github.com/vegastrike/Vega-Strike-Engine-Source/blob/master/engine/src/gnuhash.h#L76.

What version are you compiling so we can be sure it gets fixed. Thanks!

GZouw commented 8 months ago

What version are you compiling so we can be sure it gets fixed. Thanks!

I was compiling v0.8.0 (which I thought was the stable release).

BenjamenMeyer commented 7 months ago

@GZouw yes, it is the current stable release; we're working on getting 0.9.x out the door. Thanks.

NOTE: it should be finding our built-in hash_compare method still - see https://github.com/vegastrike/Vega-Strike-Engine-Source/blob/0.8.x/engine/src/gnuhash.h#L81C7-L81C19.

Will take a look.