Fantastic Umbrella
Fantastic Umbrella

Reputation: 1

ProtocolBuffer C++ Visual Studio 2019

I am trying to build Protocolbuffer for Visual Studio 2019 x86,

I followed the steps in this page https://github.com/protocolbuffers/protobuf/blob/main/cmake/README.md

for release I tried:

cmake -G "NMake Makefiles" ^
 -DCMAKE_BUILD_TYPE=Release ^
 -DCMAKE_GENERATOR_PLATFORM=Win32 ^
 -DCMAKE_INSTALL_PREFIX=C:\protocolbuffers\install ^
 C:\protocolbuffers\protobuf

I have the error

CMake Error at CMakeLists.txt:24 (project): Generator

NMake Makefiles

does not support platform specification, but platform

Win32

was specified.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

if I removed the -DCMAKE_GENERATOR_PLATFORM=Win32 ^ I can create the correct files but when I compile the error is

protocolbuffers\protobuf\src\google\protobuf\extension_set_unittest.cc(871): note: see reference to function template instantiation 'int google::protobuf::internal::RepeatedFieldLowerClampLimit<int64_t,4>(void)' being compiled NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2' Stop.

I need to create the lib files for:

libprotobuf.lib, libprotobuf-lite.lib, libprotoc.lib

and

protoc.exe

Upvotes: 0

Views: 810

Answers (0)

Related Questions