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

Add a VS2015 debugging version of libprotobuf.lib #113

Open
wants to merge 1 commit into
base: csgo
Choose a base branch
from

Conversation

AnthonyIacono
Copy link

@AnthonyIacono AnthonyIacono commented Nov 8, 2022

In order to properly build SourceMod in debug mode on Windows, we need to have the libprotobuf.lib that was linked with the MSVC 2015 toolset.

This was created using the following steps:

  1. Download the protobuf 2.5.0 ZIP file from here: https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.zip

  2. Add macro definitions for the following in common.h:

    #if defined(_WIN32) && !defined(min)
    #define min(a,b) __min(a,b)
    #define max(a,b) __max(a,b)
    #endif
    
    #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
    
  3. Open the solution file in VS 2022 and migrate it from the old file format

  4. Right click the "libprotobuf" project and...

    • Switch Platform Toolset to "Visual Studio 2015 (v140)"
    • Switch Target Platform Version to "10.0.19041.0"
    • Code Generation -> Runtime Library -> /MTd
    • Preprocessor Definitions -> Add -> _ITERATOR_DEBUG_LEVEL=0
  5. Build the libprotobuf project, and that's it!

In order to properly build SourceMod in debug mode on Windows, we need to have the `libprotobuf.lib` that was linked with the MSVC 2015 toolset.

This was created using the following steps:
1) Download the protobuf 2.5.0 ZIP file from here: https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.zip
2) Add macro definitions for the following in `common.h`:
    ```
    #if defined(_WIN32) && !defined(min)
    #define min(a,b) __min(a,b)
    #define max(a,b) __max(a,b)
    #endif

    #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
    ```

3) Open the solution file in VS 2022 and migrate it from the old file format
4) Right click the "libprotobuf" project and...
    - Switch Platform Toolset to "Visual Studio 2015 (v140)"
    - Switch Target Platform Version to "10.0.19041.0"
    - Code Generation -> Runtime Library -> /MTd
    - Preprocessor Definitions -> Add -> _ITERATOR_DEBUG_LEVEL=0
5) Build the `libprotobuf` project, and that's it!
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

Successfully merging this pull request may close these issues.

1 participant