ValveSoftware / csgo-demoinfo

CS:GO demo parsing tool
BSD 2-Clause "Simplified" License
489 stars 101 forks source link

Building in visual studio 2015 #9

Open Tfelk opened 8 years ago

Tfelk commented 8 years ago

Is this possible? Im getting a few errors trying to build "libprotobuf" as described in the readme. Maybe its because im in VS2015.

Here are the errors:

1>C:\Program Files (x86)\VC\include\hash_map(17): error C2338: is deprecated and will be REMOVED. Please use . You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning. 1>C:\Program Files (x86)\VC\include\hash_set(17): error C2338: is deprecated and will be REMOVED. Please use . You can define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS to acknowledge that you have received this warning.

This pair of errors occurs 6 times, additionally:

1>..\src\google\protobuf\io\zero_copy_stream_impl_lite.cc(66): error C3861: 'min': identifier not found 1>..\src\google\protobuf\io\zero_copy_stream_impl_lite.cc(119): error C3861: 'min': identifier not found 1>..\src\google\protobuf\io\zero_copy_stream_impl_lite.cc(166): error C3861: 'max': identifier not found 1>..\src\google\protobuf\io\zero_copy_stream_impl_lite.cc(193): error C3861: 'min': identifier not found

cookieseller commented 8 years ago

Hey, I'm not too sure what changed between VS2010 and VS2015 but these errors can easily be fixed. For the hash_map error do as it says, define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS and the min max errors can be fixed by including algorithm in the mentioned file. Note that I'm not sure if this is the correct solution or why algorithm wasn't included in the first place but for me this fixed all errors and I can build on VS2015.

jacobxy commented 8 years ago

You can write the code by yourself like this:

define min(x,y) x>y?y:x

define max(x,y) x>y?x:y

patrikohlsson commented 8 years ago

That could cause precedence issues, if you're defining them yourself it should be:

#define min(x,y) ((x)>(y)?(y):(x)) 
#define max(x,y) ((x)>(y)?(x):(y))

Just including the algorithm header and defining _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS solves it too.

EDIT: Statement should also have surrounding parenthesis

bjj commented 8 years ago

Actually the whole thing should be in parenthesis too.

On Mon, Sep 26, 2016 at 12:01 PM, patrikohlsson notifications@github.com wrote:

That could cause precedence issues, if you're defining them yourself it should be:

define min(x,y) (x)>(y)?(y):(x)

define max(x,y) (x)>(y)?(x):(y)

Just including the algorithm header and defining _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS solves it too.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/csgo-demoinfo/issues/9#issuecomment-249664737, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD0TZjnNx05RuaubP-B9lU6QX0l6vYxks5quBZugaJpZM4JCngK .

patrikohlsson commented 8 years ago

Yes, forgot about that!

lemming52 commented 7 years ago

Might be foolish, but I'm having crashes after building related to heap corruption and access violation in the protobuf. I'm using vs2017 and applied they above workarounds to hash map and min/max. Is this likely some kind of configuration error on my part?

jacobxy commented 7 years ago

I am trying to write this in golang!

ghost commented 6 years ago

@bjj Worked without extra parenthesis.

@lemming52 Works for me in VS2013 Community.

mshaheerm commented 6 years ago

capture I am having these errors in VS2017. how can i fix them and where do i need to append_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS ??