Skip to content

Convenience script for Visual Studio 2019 #33

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

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

Conversation

foooorsyth
Copy link

@foooorsyth foooorsyth commented Feb 3, 2020

I added a simple PowerShell script that automates first build for Visual Studio 2019. All protobuf dependencies are resolved automatically. Makes getting started much easier for people who want to move on from VS2010.

Instructions have been added to the second-level README

This script should work out of the box on any modern Windows machine -- PS, tar, and curl are preinstalled with the OS these days.

@clankill3r
Copy link

I know it says Visual Studio 2019, but I removed that cause Unreal Engine was not playing nice.
I was wondering if it worked in VS 2022, it did not. I dump the ouput here for in case someone is interested.
When I have time again I will install VS 2019 and try again.

Microsoft Visual Studio 2022 Version 17.4.1.
Copyright (C) Microsoft Corp. All rights reserved.
Build started...
1>------ Build started: Project: libprotobuf, Configuration: Release Win32 ------
1>importer.cc
1>parser.cc
1>descriptor.cc
1>descriptor.pb.cc
1>descriptor_database.cc
1>dynamic_message.cc
1>extension_set.cc
1>extension_set_heavy.cc
1>generated_message_reflection.cc
1>generated_message_util.cc
1>coded_stream.cc
1>gzip_stream.cc
1>printer.cc
1>tokenizer.cc
1>zero_copy_stream.cc
1>zero_copy_stream_impl.cc
1>zero_copy_stream_impl_lite.cc
1>message.cc
1>message_lite.cc
1>reflection_ops.cc
1>Generating Code...
1>C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\protobuf-2.5.0\src\google\protobuf\io\zero_copy_stream.cc : fatal  error C1090: PDB API call failed, error code '3': C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\protobuf-2.5.0\vsprojects\Release\libprotobuf.pdb
1>Done building project "libprotobuf.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Elapsed 00:08.705 ==========

Microsoft Visual Studio 2022 Version 17.4.1.
Copyright (C) Microsoft Corp. All rights reserved.
Upgrading project 'demoinfogo'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v143' (was 'v142').
        Configuration 'Release|Win32': changing Platform Toolset to 'v143' (was 'v142').

Microsoft Visual Studio 2022 Version 17.4.1.
Copyright (C) Microsoft Corp. All rights reserved.
Build started...
1>------ Build started: Project: demoinfogo, Configuration: Release Win32 ------
1>Running Protocol Buffer Compiler on cstrike15_usermessages_public.proto...
1>Running Protocol Buffer Compiler on netmessages_public.proto...
1>demofile.cpp
1>demofilebitbuf.cpp
1>C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\demofilebitbuf.cpp(671,14): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
1>demofiledump.cpp
1>C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\demofiledump.cpp(713,13): warning C4477: 'printf' : format string '%s' requires an argument of type 'char *', but variadic argument 4 has type 'const void *'
1>demoinfogo.cpp
1>demofilepropdecode.cpp
1>cstrike15_usermessages_public.pb.cc
1>netmessages_public.pb.cc
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(1096,5): error MSB6006: "link.exe" exited with code 1181.
1>LINK : fatal error LNK1181: cannot open input file 'protobuf-2.5.0\vsprojects\Release\libprotobuf.lib'
1>Done building project "demoinfogo.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Elapsed 00:04.167 ==========

@clankill3r
Copy link

clankill3r commented Jan 18, 2024

Ok, One problem was that I had Dropbox on. So maybe 2022 worked...

Anyway now I have this:

Microsoft Visual Studio 2019 Version 16.11.33.
Copyright (C) Microsoft Corp. All rights reserved.

Migration completed successfully, but some warnings were detected during migration.
For more information, see the migration report:
C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\protobuf-2.5.0\vsprojects\UpgradeLog2.htm
        1 file(s) moved.
        1 file(s) moved.
        1 file(s) moved.
        1 file(s) moved.

Microsoft Visual Studio 2019 Version 16.11.33.
Copyright (C) Microsoft Corp. All rights reserved.
Build started...
1>------ Build started: Project: libprotobuf, Configuration: Release Win32 ------
1>importer.cc
1>parser.cc
1>descriptor.cc
1>descriptor.pb.cc
1>descriptor_database.cc
1>dynamic_message.cc
1>extension_set.cc
1>extension_set_heavy.cc
1>generated_message_reflection.cc
1>generated_message_util.cc
1>coded_stream.cc
1>gzip_stream.cc
1>printer.cc
1>tokenizer.cc
1>zero_copy_stream.cc
1>zero_copy_stream_impl.cc
1>zero_copy_stream_impl_lite.cc
1>reflection_ops.cc
1>repeated_field.cc
1>service.cc
1>Generating Code...
1>Compiling...
1>atomicops_internals_x86_msvc.cc
1>common.cc
1>once.cc
1>stringprintf.cc
1>structurally_valid.cc
1>strutil.cc
1>substitute.cc
1>text_format.cc
1>unknown_field_set.cc
1>wire_format.cc
1>wire_format_lite.cc
1>Generating Code...
1>libprotobuf.vcxproj -> C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\protobuf-2.5.0\vsprojects\Release\libprotobuf.lib
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Microsoft Visual Studio 2019 Version 16.11.33.
Copyright (C) Microsoft Corp. All rights reserved.
Upgrading project 'demoinfogo'...
        Configuration 'Debug|Win32': no platform toolset upgrade required. Platform Toolset is 'v142'.
        Configuration 'Release|Win32': no platform toolset upgrade required. Platform Toolset is 'v142'.

Migration completed successfully, but some warnings were detected during migration.
For more information, see the migration report:
C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\UpgradeLog2.htm

Microsoft Visual Studio 2019 Version 16.11.33.
Copyright (C) Microsoft Corp. All rights reserved.
Build started...
1>------ Build started: Project: demoinfogo, Configuration: Release Win32 ------
1>Generating code
1>Previous IPDB not found, fall back to full compilation.
1>All 4565 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
1>Finished generating code
1>demoinfogo.vcxproj -> C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\Release\demoinfogo.exe
1>The system cannot find the file specified.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: The command "copy C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\Release\demoinfogo.exe C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: :VCEnd" exited with code 1.
1>Done building project "demoinfogo.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

As you can see the second build failed.
But I have reason to believe that this has nothing to do with your script.

Look at this line for example:

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(155,5): error MSB3073: The command "copy C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\Release\demoinfogo.exe C:\Users\clank\Dropbox\03 - Active Projects\10 - CSGO_Demos\csgo-demoinfo\demoinfogo\

It seems since the path is not quoted that spaces might be the problem.

Anyway, if I look in the demoinfogo/Release folder then demoinfogo.exe is there and it seems to work (didn't test with a dem file yet cause I don't have one atm).

Also it makes me wonder why the executable is not on the release page...

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.

2 participants