ValveSoftware / csgo-demoinfo

CS:GO demo parsing tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building in visual studio 2015

Tfelk opened this issue · comments

commented

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: <hash_map> is deprecated and will be REMOVED. Please use <unordered_map>. 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: <hash_set> is deprecated and will be REMOVED. Please use <unordered_set>. 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

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.

commented

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

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

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
#9 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAD0TZjnNx05RuaubP-B9lU6QX0l6vYxks5quBZugaJpZM4JCngK
.

Yes, forgot about that!

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?

commented

I am trying to write this in golang!

@bjj Worked without extra parenthesis.

@lemming52 Works for me in VS2013 Community.

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 ??