openpose icon indicating copy to clipboard operation
openpose copied to clipboard

Openpose failed to build with error C2121: '#': invalid character: possibly the result of a macro expansion with MSVC on windows

Open YangYang129 opened this issue 3 years ago • 0 comments

Openpose failed to build with error C2121: '#': invalid character: possibly the result of a macro expansion with MSVC on windows. It can reproduces on version https://github.com/CMU-Perceptual-Computing-Lab/openpose/commit/607a0125a8d9fa17f639518cb8d8bfa9df3cd68e. Could you please help look at this issue? Thank you very much

Environment Compiler version: VS2019 (16.11.9) Operating system: Windows server 2019

Steps to reproduce:

  1. open VS2019 x64 tools command
  2. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm64
  3. git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose f:\openpose
  4. cd f:\openpose
  5. git submodule update --init --recursive
  6. mkdir build_arm64 & cd build_arm64
  7. cmake -G "Visual Studio 16 2019" -A arm64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release -DGPU_MODE=CPU_ONLY ..
  8. msbuild /m /p:Platform=arm64 /p:Configuration=Release OpenPose.sln /t:Rebuild

Build.log openpose_msbuild.log

Error info: 25>F:\openpose\3rdparty\windows\caffe3rdparty\include\google/protobuf/stubs/platform_macros.h(94,1): error C2121: '#': invalid character: possibly the result of a macro expansion (compiling source file F:\openpose\src\openpose\core\arrayCpuGpu.cpp) [f:\openpose\build_arm64\src\openpose\openpose.vcxproj] 25>F:\openpose\3rdparty\windows\caffe3rdparty\include\google/protobuf/stubs/platform_macros.h(94,1): error C2143: syntax error: missing ';' before 'string' (compiling source file F:\openpose\src\openpose\core\arrayCpuGpu.cpp) [f:\openpose\build_arm64\src\openpose\openpose.vcxproj] 25>F:\openpose\3rdparty\windows\caffe3rdparty\include\google/protobuf/stubs/platform_macros.h(94,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file F:\openpose\src\openpose\core\arrayCpuGpu.cpp) [f:\openpose\build_arm64\src\openpose\openpose.vcxproj] 25>F:\openpose\3rdparty\windows\caffe3rdparty\include\google/protobuf/stubs/logging.h(40,18): error C2143: syntax error: missing ';' before '{' (compiling source file F:\openpose\src\openpose\core\arrayCpuGpu.cpp) [f:\openpose\build_arm64\src\openpose\openpose.vcxproj] 25>F:\openpose\3rdparty\windows\caffe3rdparty\include\google/protobuf/stubs/logging.h(40,18): error C2447: '{': missing function header (old-style formal list?) (compiling source file F:\openpose\src\openpose\core\arrayCpuGpu.cpp) [f:\openpose\build_arm64\src\openpose\openpose.vcxproj] 25>F:\openpose\3rdparty\windows\caffe3rdparty\include\google/protobuf/stubs/atomicops.h(186,1): fatal error C1189: #error: GOOGLE_PROTOBUF_ATOMICOPS_ERROR (compiling source file F:\openpose\src\openpose\core\arrayCpuGpu.cpp) [f:\openpose\build_arm64\src\openpose\openpose.vcxproj]

YangYang129 avatar Mar 28 '22 07:03 YangYang129