问:
/build/include\caffe/proto/caffe.pb.h(4356): error : expected an identifier while compiling Caffe on windows
I am trying to port Caffe-SSD to Windows. I moved all the new files (layers and whatnot) to the Caffe's latest windows branch and used the Caffe_SSD caffe.proto file and initiated the compilation process.
It seemed everything is in place but after several minutes of compilation it fails with these errors :

```<code>"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (default target) (3) ->
(CustomBuild target) ->
  C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/include\caffe/proto/caffe.pb.h(4356): error : expected an ident
ifier [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/include\caffe/proto/caffe.pb.h(14835): error : expected an iden
tifier [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]

    414 Warning(s)
    2 Error(s)

Time Elapsed 00:08:49.15
ERROR: Build failed
</code>```

Why am I getting this error? I used the very same caffe.proto from the ssd branch and therefore everything needs to be fine! where is the problem?

This is the configuration by the way :

```<code> C:\Users\Master\Desktop\Caffe\caffe-windows-ssd>scripts\build_win.cmd
The system cannot find the drive specified.
The system cannot find the drive specified.
INFO: ============================================================
INFO: Summary:
INFO: ============================================================
INFO: MSVC_VERSION               = 14
INFO: WITH_NINJA                 = 0
INFO: CMAKE_GENERATOR            = "Visual Studio 14 2015 Win64"
INFO: CPU_ONLY                   = 0
INFO: CUDA_ARCH_NAME             = Auto
INFO: CMAKE_CONFIG               = Release
INFO: USE_NCCL                   = 0
INFO: CMAKE_BUILD_SHARED_LIBS    = 0
INFO: PYTHON_VERSION             = 3
INFO: BUILD_PYTHON               = 1
INFO: BUILD_PYTHON_LAYER         = 1
INFO: BUILD_MATLAB               = 0
INFO: PYTHON_EXE                 = "python"
INFO: RUN_TESTS                  = 0
INFO: RUN_LINT                   = 0
INFO: RUN_INSTALL                = 1
INFO: ============================================================
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: C:/Users/Master/Anaconda3/envs/anaconda35/python.exe (found suitable version "3.5.3", minimum required is "2.7")
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Boost version: 1.61.0
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
--   chrono
--   date_time
--   atomic
-- Found GFlags: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found gflags  (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: gflags_shared)
-- Found Glog: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found glog    (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: glog)
-- Found Protobuf: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/bin/protoc.exe (found version "3.1.0")
-- Found PROTOBUF Compiler: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/bin/protoc.exe
-- Found LMDB: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found lmdb    (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: lmdb)
-- Found LevelDB: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found LevelDB (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: leveldb)
-- Found ZLIB: optimized;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlib.lib;debug;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlibd.lib (found version "1.2.8")
-- Found Snappy: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found Snappy  (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: snappy_static;optimized;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlib.lib;debug;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlibd.lib)
-- CUDA detected: 8.0
-- Found cuDNN: ver. 6.0.20 found (include: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/cuda60/cuda/include, library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/cuda60/cuda/lib/x64/cudnn.lib)
-- Added CUDA NVCC flags for: sm_61
-- OpenCV found (C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries)
-- Found OpenBLAS libraries: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/libopenblas.dll.a
-- Found OpenBLAS include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found PythonLibs: C:/Users/Master/Anaconda3/envs/anaconda35/libs/python35.lib (found suitable version "3.5.3", minimum required is "2.7")
-- Found NumPy: C:/Users/Master/Anaconda3/envs/anaconda35/lib/site-packages/numpy/core/include (found suitable version "1.13.1", minimum required is "1.7.1")
-- NumPy ver. 1.13.1 found (include: C:/Users/Master/Anaconda3/envs/anaconda35/lib/site-packages/numpy/core/include)
-- Boost version: 1.61.0
-- Found the following Boost libraries:
--   python
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.10.1.windows.1")
--
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   1.0.0
--   Git               :   unknown
--   System            :   Windows
--   C++ compiler      :   C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
--   Release CXX flags :   /MD /O2 /Ob2 /DNDEBUG /DWIN32 /D_WINDOWS /W3 /GR /EHsc
--   Debug CXX flags   :   /MDd /Zi /Ob0 /Od /RTC1 /DWIN32 /D_WINDOWS /W3 /GR /EHsc
--   Build type        :   Release
--
--   BUILD_SHARED_LIBS :   0
--   BUILD_python      :   1
--   BUILD_matlab      :   0
--   BUILD_docs        :
--   CPU_ONLY          :   0
--   USE_OPENCV        :   ON
--   USE_LEVELDB       :   ON
--   USE_LMDB          :   ON
--   USE_NCCL          :   0
--   ALLOW_LMDB_NOLOCK :   OFF
--
-- Dependencies:
--   BLAS              :   Yes (Open)
--   Boost             :   Yes (ver. 1.61)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 3.1.0)
--   lmdb              :   Yes (ver. 0.9.70)
--   LevelDB           :   Yes (ver. 1.18)
--   Snappy            :   Yes (ver. 1.1.1)
--   OpenCV            :   Yes (ver. 3.1.0)
--   CUDA              :   Yes (ver. 8.0)
--
-- NVIDIA CUDA:
--   Target GPU(s)     :   Auto
--   GPU arch(s)       :   sm_61
--   cuDNN             :   Yes (ver. 6.0.20)
--
-- Python:
--   Interpreter       :   C:/Users/Master/Anaconda3/envs/anaconda35/python.exe (ver. 3.5.3)
--   Libraries         :   C:/Users/Master/Anaconda3/envs/anaconda35/libs/python35.lib (ver 3.5.3)
--   NumPy             :   C:/Users/Master/Anaconda3/envs/anaconda35/lib/site-packages/numpy/core/include (ver 1.13.1)
--
-- Install:
--   Install path      :   C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/install
--
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 9/16/2017 10:12:06 PM.
Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" on node 1 (default targets).
Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (1) is building "C:\Users\Master\Desk
top\Caffe\caffe-windows-ssd\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "x64\Release\ZERO_CHECK\".
  Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\".
InitializeBuildStatus:
  Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
  Checking Build System
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/CMakeFiles/generate.stamp
   is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/gtest/CMakeFiles/gene
  rate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/caffe/CMakeFiles/gene
  rate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/caffe/test/CMakeFiles
  /generate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/tools/CMakeFiles/generate
  .stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/examples/CMakeFiles/gener
  ate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/python/CMakeFiles/generat
  e.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/matlab/CMakeFiles/generat
  e.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/docs/CMakeFiles/generate.
  stamp is up-to-date.
FinalizeBuildStatus:
  Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
  Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ZERO_CHECK.vcxproj" (default targets).

Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (1) is building "C:\Users\Master\Desk
top\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (3) on node 1 (default targets).
Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (3) is building "C:\Users\Maste
r\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffeproto.vcxproj" (4) on node 1 (default targets).
PrepareForBuild:
  Creating directory "caffeproto.dir\Release\".
  Creating directory "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\lib\Release\".
  Creating directory "caffeproto.dir\Release\caffeproto.tlog\".
InitializeBuildStatus:
  Creating "caffeproto.dir\Release\caffeproto.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ComputeCustomBuildOutput:
  Creating directory "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\include\caffe\proto\".
CustomBuild:
  Building Custom Rule C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/src/caffe/CMakeLists.txt
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/caffe/CMakeFiles/gene
  rate.stamp is up-to-date.
  Running C++/Python protocol buffer compiler on C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/src/caffe/proto/caffe.
  proto
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /I"C:\Users\Master\Desktop\Caffe\caffe
  -windows-ssd\build\include" /I"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build" /IC:\Users\Master\.caffe\depend
  encies\libraries_v140_x64_py35_1.1.0\libraries\include /nologo /W3 /WX- /O2 /Ob2 /D WIN32 /D _WINDOWS /D NDEBUG /D CA
  FFE_VERSION=1.0.0 /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:
  inline /GR /Fo"caffeproto.dir\Release\\" /Fd"caffeproto.dir\Release\caffeproto.pdb" /Gd /TP /errorReport:queue "C:\Us
  ers\Master\Desktop\Caffe\caffe-windows-ssd\build\include\caffe\proto\caffe.pb.cc"
  caffe.pb.cc
</code>```

This is the content of caffe.pb.h line 4356:

```<code>  // nested types ----------------------------------------------------

  typedef ParamSpec_DimCheckMode DimCheckMode;
  static const DimCheckMode STRICT =
    ParamSpec_DimCheckMode_STRICT;
  static const DimCheckMode PERMISSIVE =
    ParamSpec_DimCheckMode_PERMISSIVE;
  static inline bool DimCheckMode_IsValid(int value) {
    return ParamSpec_DimCheckMode_IsValid(value);
  }
  static const DimCheckMode DimCheckMode_MIN =
    ParamSpec_DimCheckMode_DimCheckMode_MIN;
  static const DimCheckMode DimCheckMode_MAX =
    ParamSpec_DimCheckMode_DimCheckMode_MAX;
  static const int DimCheckMode_ARRAYSIZE =
    ParamSpec_DimCheckMode_DimCheckMode_ARRAYSIZE;
  static inline const ::google::protobuf::EnumDescriptor*
  DimCheckMode_descriptor() {
    return ParamSpec_DimCheckMode_descriptor();
  }
  static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) {
    return ParamSpec_DimCheckMode_Name(value);
  }
  static inline bool DimCheckMode_Parse(const ::std::string& name,
      DimCheckMode* value) {
    return ParamSpec_DimCheckMode_Parse(name, value);
  }
</code>```

and the line 14835:

```<code> typedef V1LayerParameter_DimCheckMode DimCheckMode;
  static const DimCheckMode STRICT =
    V1LayerParameter_DimCheckMode_STRICT;
  static const DimCheckMode PERMISSIVE =
    V1LayerParameter_DimCheckMode_PERMISSIVE;
  static inline bool DimCheckMode_IsValid(int value) {
    return V1LayerParameter_DimCheckMode_IsValid(value);
  }
  static const DimCheckMode DimCheckMode_MIN =
    V1LayerParameter_DimCheckMode_DimCheckMode_MIN;
  static const DimCheckMode DimCheckMode_MAX =
    V1LayerParameter_DimCheckMode_DimCheckMode_MAX;
  static const int DimCheckMode_ARRAYSIZE =
    V1LayerParameter_DimCheckMode_DimCheckMode_ARRAYSIZE;
  static inline const ::google::protobuf::EnumDescriptor*
  DimCheckMode_descriptor() {
    return V1LayerParameter_DimCheckMode_descriptor();
  }
  static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) {
    return V1LayerParameter_DimCheckMode_Name(value);
  }
  static inline bool DimCheckMode_Parse(const ::std::string& name,
      DimCheckMode* value) {
    return V1LayerParameter_DimCheckMode_Parse(name, value);
  }
</code>```

In case, full compilation log is needed, the complete log is here

This is the content of caffe.proto which I have used (copied from linux ssd)
Caffe.proto From caffe_ssd_linux

Caffe.proto From caffe-windows

Update 2:

replacing STRICT with _STRICT and PERMISSIVE with _PERMISSIVE resulted in these errors :

```<code>"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (default target) (3) ->
(ClCompile target) ->
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(59): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<fl
oat>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(60): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>
>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(60): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\D
esktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(104): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<f
loat>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(105): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtyp
e>>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(105): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\
Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(157): error C2039: 'DistortImage': is not a member of 'caffe::DataTransformer<Dtype>
' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(161): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(168): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(183): error C2039: 'CropImage': is not a member of 'caffe::DataTransformer<Dtype>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(229): error C2661: 'caffe::DataTransformer<Dtype>::Transform': no overloaded functio
n takes 3 arguments [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(59): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<do
uble>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(60): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>
>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(104): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<d
ouble>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(105): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtyp
e>>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(157): error C2039: 'DistortImage': is not a member of 'caffe::DataTransformer<Dtype>
' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(161): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(168): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(183): error C2039: 'CropImage': is not a member of 'caffe::DataTransformer<Dtype>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(229): error C2661: 'caffe::DataTransformer<Dtype>::Transform': no overloaded functio
n takes 3 arguments [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(65): error C3861: 'MapLabelToName': identifier not found [C:\Users\Master\Desktop\
Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(67): error C3861: 'MapLabelToDisplayName': identifier not found [C:\Users\Master\D
esktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(462): error C2039: 'TransformInv': is not a member of 'caffe::DataTransformer<Dtyp
e>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(462): error C2039: 'TransformInv': is not a member of 'caffe::DataTransformer<Dtyp
e>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\infogain_loss_layer.cpp(18): error C2039: 'axis': is not a member of 'caffe::InfogainLossParameter' [C:\Users
\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\infogain_loss_layer.cpp(57): error C2039: 'axis': is not a member of 'caffe::InfogainLossParameter' [C:\Users
\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(243): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(243): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(249): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(249): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(281): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(281): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(322): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(322): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(243): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(249): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(281): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(322): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(70): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<float>' [C
:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(71): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(71): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\Deskt
op\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(80): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<float>' [C
:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(81): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>'
[C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(81): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\Deskt
op\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(70): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<double>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(71): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(80): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<double>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(81): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>'
[C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]

    1618 Warning(s)
    48 Error(s)

Time Elapsed 00:12:50.35
ERROR: Build failed
</code>```

答:
I was having the issues that you had in Update 2 and with a bit of luck and googling I was able to solve them. So here it goes for the ones suffering from them,

I found this thread on GitHub which says,

PREFETCH_COUNT should be changed to prefetch_.size() in every troubling cpp file under <CAFFE_DIR>\caffe\src\caffe\layers. In your case they should be annotated_data_layer.cpp and video_data_layer.cpp.

this->prefetch_[i]. should be changed to this->prefetch_[i]-> in every troubling cpp file under <CAFFE_DIR>\caffe\src\caffe\layers. In your case they should be annotated_data_layer.cpp and video_data_layer.cpp. This will solve errors related to label_': is not a member, data_': is not a member and left of '.Reshape' must have class/struct/union

For infogain_loss_layer.cpp(18): error C2039: 'axis': is not a member of caffe::InfogainLossParameter error, you need to add axis to InfogainLossParameter message in caffe.proto file. In my case last used id was 1, so I added it as optional int32 axis = 2; Now InfogainLossParameter message is like below,

```<code>message InfogainLossParameter {
  // Specify the infogain matrix source.
  optional string source = 1;
  optional int32 axis = 2;
}
</code>```

Sadly, I don't think this will solve all your issues, the ones related to DataTransformer will remain but I hope it will help someone to fix some of them without spending as much time as I did.

Body:
I am trying to port Caffe-SSD to Windows. I moved all the new files (layers and whatnot) to the Caffe's latest windows branch and used the Caffe_SSD caffe.proto file and initiated the compilation process.
It seemed everything is in place but after several minutes of compilation it fails with these errors :

"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (default target) (3) ->
(CustomBuild target) ->
  C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/include\caffe/proto/caffe.pb.h(4356): error : expected an ident
ifier [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/include\caffe/proto/caffe.pb.h(14835): error : expected an iden
tifier [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]

    414 Warning(s)
    2 Error(s)

Time Elapsed 00:08:49.15
ERROR: Build failed

Why am I getting this error? I used the very same caffe.proto from the ssd branch and therefore everything needs to be fine! where is the problem?

This is the configuration by the way :

 C:\Users\Master\Desktop\Caffe\caffe-windows-ssd>scripts\build_win.cmd
The system cannot find the drive specified.
The system cannot find the drive specified.
INFO: ============================================================
INFO: Summary:
INFO: ============================================================
INFO: MSVC_VERSION               = 14
INFO: WITH_NINJA                 = 0
INFO: CMAKE_GENERATOR            = "Visual Studio 14 2015 Win64"
INFO: CPU_ONLY                   = 0
INFO: CUDA_ARCH_NAME             = Auto
INFO: CMAKE_CONFIG               = Release
INFO: USE_NCCL                   = 0
INFO: CMAKE_BUILD_SHARED_LIBS    = 0
INFO: PYTHON_VERSION             = 3
INFO: BUILD_PYTHON               = 1
INFO: BUILD_PYTHON_LAYER         = 1
INFO: BUILD_MATLAB               = 0
INFO: PYTHON_EXE                 = "python"
INFO: RUN_TESTS                  = 0
INFO: RUN_LINT                   = 0
INFO: RUN_INSTALL                = 1
INFO: ============================================================
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: C:/Users/Master/Anaconda3/envs/anaconda35/python.exe (found suitable version "3.5.3", minimum required is "2.7")
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Boost version: 1.61.0
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
--   chrono
--   date_time
--   atomic
-- Found GFlags: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found gflags  (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: gflags_shared)
-- Found Glog: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found glog    (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: glog)
-- Found Protobuf: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/bin/protoc.exe (found version "3.1.0")
-- Found PROTOBUF Compiler: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/bin/protoc.exe
-- Found LMDB: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found lmdb    (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: lmdb)
-- Found LevelDB: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found LevelDB (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: leveldb)
-- Found ZLIB: optimized;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlib.lib;debug;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlibd.lib (found version "1.2.8")
-- Found Snappy: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found Snappy  (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: snappy_static;optimized;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlib.lib;debug;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlibd.lib)
-- CUDA detected: 8.0
-- Found cuDNN: ver. 6.0.20 found (include: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/cuda60/cuda/include, library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/cuda60/cuda/lib/x64/cudnn.lib)
-- Added CUDA NVCC flags for: sm_61
-- OpenCV found (C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries)
-- Found OpenBLAS libraries: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/libopenblas.dll.a
-- Found OpenBLAS include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found PythonLibs: C:/Users/Master/Anaconda3/envs/anaconda35/libs/python35.lib (found suitable version "3.5.3", minimum required is "2.7")
-- Found NumPy: C:/Users/Master/Anaconda3/envs/anaconda35/lib/site-packages/numpy/core/include (found suitable version "1.13.1", minimum required is "1.7.1")
-- NumPy ver. 1.13.1 found (include: C:/Users/Master/Anaconda3/envs/anaconda35/lib/site-packages/numpy/core/include)
-- Boost version: 1.61.0
-- Found the following Boost libraries:
--   python
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.10.1.windows.1")
--
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   1.0.0
--   Git               :   unknown
--   System            :   Windows
--   C++ compiler      :   C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
--   Release CXX flags :   /MD /O2 /Ob2 /DNDEBUG /DWIN32 /D_WINDOWS /W3 /GR /EHsc
--   Debug CXX flags   :   /MDd /Zi /Ob0 /Od /RTC1 /DWIN32 /D_WINDOWS /W3 /GR /EHsc
--   Build type        :   Release
--
--   BUILD_SHARED_LIBS :   0
--   BUILD_python      :   1
--   BUILD_matlab      :   0
--   BUILD_docs        :
--   CPU_ONLY          :   0
--   USE_OPENCV        :   ON
--   USE_LEVELDB       :   ON
--   USE_LMDB          :   ON
--   USE_NCCL          :   0
--   ALLOW_LMDB_NOLOCK :   OFF
--
-- Dependencies:
--   BLAS              :   Yes (Open)
--   Boost             :   Yes (ver. 1.61)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 3.1.0)
--   lmdb              :   Yes (ver. 0.9.70)
--   LevelDB           :   Yes (ver. 1.18)
--   Snappy            :   Yes (ver. 1.1.1)
--   OpenCV            :   Yes (ver. 3.1.0)
--   CUDA              :   Yes (ver. 8.0)
--
-- NVIDIA CUDA:
--   Target GPU(s)     :   Auto
--   GPU arch(s)       :   sm_61
--   cuDNN             :   Yes (ver. 6.0.20)
--
-- Python:
--   Interpreter       :   C:/Users/Master/Anaconda3/envs/anaconda35/python.exe (ver. 3.5.3)
--   Libraries         :   C:/Users/Master/Anaconda3/envs/anaconda35/libs/python35.lib (ver 3.5.3)
--   NumPy             :   C:/Users/Master/Anaconda3/envs/anaconda35/lib/site-packages/numpy/core/include (ver 1.13.1)
--
-- Install:
--   Install path      :   C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/install
--
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 9/16/2017 10:12:06 PM.
Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" on node 1 (default targets).
Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (1) is building "C:\Users\Master\Desk
top\Caffe\caffe-windows-ssd\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "x64\Release\ZERO_CHECK\".
  Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\".
InitializeBuildStatus:
  Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
  Checking Build System
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/CMakeFiles/generate.stamp
   is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/gtest/CMakeFiles/gene
  rate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/caffe/CMakeFiles/gene
  rate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/caffe/test/CMakeFiles
  /generate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/tools/CMakeFiles/generate
  .stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/examples/CMakeFiles/gener
  ate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/python/CMakeFiles/generat
  e.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/matlab/CMakeFiles/generat
  e.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/docs/CMakeFiles/generate.
  stamp is up-to-date.
FinalizeBuildStatus:
  Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
  Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ZERO_CHECK.vcxproj" (default targets).

Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (1) is building "C:\Users\Master\Desk
top\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (3) on node 1 (default targets).
Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (3) is building "C:\Users\Maste
r\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffeproto.vcxproj" (4) on node 1 (default targets).
PrepareForBuild:
  Creating directory "caffeproto.dir\Release\".
  Creating directory "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\lib\Release\".
  Creating directory "caffeproto.dir\Release\caffeproto.tlog\".
InitializeBuildStatus:
  Creating "caffeproto.dir\Release\caffeproto.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ComputeCustomBuildOutput:
  Creating directory "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\include\caffe\proto\".
CustomBuild:
  Building Custom Rule C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/src/caffe/CMakeLists.txt
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/caffe/CMakeFiles/gene
  rate.stamp is up-to-date.
  Running C++/Python protocol buffer compiler on C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/src/caffe/proto/caffe.
  proto
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /I"C:\Users\Master\Desktop\Caffe\caffe
  -windows-ssd\build\include" /I"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build" /IC:\Users\Master\.caffe\depend
  encies\libraries_v140_x64_py35_1.1.0\libraries\include /nologo /W3 /WX- /O2 /Ob2 /D WIN32 /D _WINDOWS /D NDEBUG /D CA
  FFE_VERSION=1.0.0 /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:
  inline /GR /Fo"caffeproto.dir\Release\\" /Fd"caffeproto.dir\Release\caffeproto.pdb" /Gd /TP /errorReport:queue "C:\Us
  ers\Master\Desktop\Caffe\caffe-windows-ssd\build\include\caffe\proto\caffe.pb.cc"
  caffe.pb.cc

This is the content of caffe.pb.h line 4356:

  // nested types ----------------------------------------------------

  typedef ParamSpec_DimCheckMode DimCheckMode;
  static const DimCheckMode STRICT =
    ParamSpec_DimCheckMode_STRICT;
  static const DimCheckMode PERMISSIVE =
    ParamSpec_DimCheckMode_PERMISSIVE;
  static inline bool DimCheckMode_IsValid(int value) {
    return ParamSpec_DimCheckMode_IsValid(value);
  }
  static const DimCheckMode DimCheckMode_MIN =
    ParamSpec_DimCheckMode_DimCheckMode_MIN;
  static const DimCheckMode DimCheckMode_MAX =
    ParamSpec_DimCheckMode_DimCheckMode_MAX;
  static const int DimCheckMode_ARRAYSIZE =
    ParamSpec_DimCheckMode_DimCheckMode_ARRAYSIZE;
  static inline const ::google::protobuf::EnumDescriptor*
  DimCheckMode_descriptor() {
    return ParamSpec_DimCheckMode_descriptor();
  }
  static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) {
    return ParamSpec_DimCheckMode_Name(value);
  }
  static inline bool DimCheckMode_Parse(const ::std::string& name,
      DimCheckMode* value) {
    return ParamSpec_DimCheckMode_Parse(name, value);
  }

and the line 14835:

 typedef V1LayerParameter_DimCheckMode DimCheckMode;
  static const DimCheckMode STRICT =
    V1LayerParameter_DimCheckMode_STRICT;
  static const DimCheckMode PERMISSIVE =
    V1LayerParameter_DimCheckMode_PERMISSIVE;
  static inline bool DimCheckMode_IsValid(int value) {
    return V1LayerParameter_DimCheckMode_IsValid(value);
  }
  static const DimCheckMode DimCheckMode_MIN =
    V1LayerParameter_DimCheckMode_DimCheckMode_MIN;
  static const DimCheckMode DimCheckMode_MAX =
    V1LayerParameter_DimCheckMode_DimCheckMode_MAX;
  static const int DimCheckMode_ARRAYSIZE =
    V1LayerParameter_DimCheckMode_DimCheckMode_ARRAYSIZE;
  static inline const ::google::protobuf::EnumDescriptor*
  DimCheckMode_descriptor() {
    return V1LayerParameter_DimCheckMode_descriptor();
  }
  static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) {
    return V1LayerParameter_DimCheckMode_Name(value);
  }
  static inline bool DimCheckMode_Parse(const ::std::string& name,
      DimCheckMode* value) {
    return V1LayerParameter_DimCheckMode_Parse(name, value);
  }

In case, full compilation log is needed, the complete log is here

This is the content of caffe.proto which I have used (copied from linux ssd)
Caffe.proto From caffe_ssd_linux

Caffe.proto From caffe-windows

Update 2:

replacing STRICT with _STRICT and PERMISSIVE with _PERMISSIVE resulted in these errors :

"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (default target) (3) ->
(ClCompile target) ->
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(59): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<fl
oat>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(60): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>
>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(60): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\D
esktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(104): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<f
loat>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(105): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtyp
e>>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(105): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\
Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(157): error C2039: 'DistortImage': is not a member of 'caffe::DataTransformer<Dtype>
' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(161): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(168): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(183): error C2039: 'CropImage': is not a member of 'caffe::DataTransformer<Dtype>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(229): error C2661: 'caffe::DataTransformer<Dtype>::Transform': no overloaded functio
n takes 3 arguments [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(59): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<do
uble>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(60): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>
>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(104): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<d
ouble>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(105): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtyp
e>>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(157): error C2039: 'DistortImage': is not a member of 'caffe::DataTransformer<Dtype>
' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(161): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(168): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(183): error C2039: 'CropImage': is not a member of 'caffe::DataTransformer<Dtype>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(229): error C2661: 'caffe::DataTransformer<Dtype>::Transform': no overloaded functio
n takes 3 arguments [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(65): error C3861: 'MapLabelToName': identifier not found [C:\Users\Master\Desktop\
Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(67): error C3861: 'MapLabelToDisplayName': identifier not found [C:\Users\Master\D
esktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(462): error C2039: 'TransformInv': is not a member of 'caffe::DataTransformer<Dtyp
e>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(462): error C2039: 'TransformInv': is not a member of 'caffe::DataTransformer<Dtyp
e>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\infogain_loss_layer.cpp(18): error C2039: 'axis': is not a member of 'caffe::InfogainLossParameter' [C:\Users
\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\infogain_loss_layer.cpp(57): error C2039: 'axis': is not a member of 'caffe::InfogainLossParameter' [C:\Users
\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(243): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(243): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(249): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(249): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(281): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(281): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(322): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(322): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(243): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(249): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(281): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(322): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(70): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<float>' [C
:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(71): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(71): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\Deskt
op\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(80): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<float>' [C
:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(81): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>'
[C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(81): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\Deskt
op\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(70): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<double>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(71): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(80): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<double>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(81): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>'
[C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]

    1618 Warning(s)
    48 Error(s)

Time Elapsed 00:12:50.35
ERROR: Build failed

Body:
I was having the issues that you had in Update 2 and with a bit of luck and googling I was able to solve them. So here it goes for the ones suffering from them,

I found this thread on GitHub which says,

PREFETCH_COUNT should be changed to prefetch_.size() in every troubling cpp file under <CAFFE_DIR>\caffe\src\caffe\layers. In your case they should be annotated_data_layer.cpp and video_data_layer.cpp.

this->prefetch_[i]. should be changed to this->prefetch_[i]-> in every troubling cpp file under <CAFFE_DIR>\caffe\src\caffe\layers. In your case they should be annotated_data_layer.cpp and video_data_layer.cpp. This will solve errors related to label_': is not a member, data_': is not a member and left of '.Reshape' must have class/struct/union

For infogain_loss_layer.cpp(18): error C2039: 'axis': is not a member of caffe::InfogainLossParameter error, you need to add axis to InfogainLossParameter message in caffe.proto file. In my case last used id was 1, so I added it as optional int32 axis = 2; Now InfogainLossParameter message is like below,

message InfogainLossParameter {
  // Specify the infogain matrix source.
  optional string source = 1;
  optional int32 axis = 2;
}

Sadly, I don't think this will solve all your issues, the ones related to DataTransformer will remain but I hope it will help someone to fix some of them without spending as much time as I did.


来源: stackexchange

问:
CSS transform does not get applied on elements selected by :nth-child()
Consider the following HTML:

```<code><p>
  <span> A </span>
  <span> A </span>
  <span> A </span>
</p>
</code>```

Now try applying this CSS on it:

```<code>p span:nth-of-type(2) {transform: rotateX( 180deg ) ; color: blue }
</code>```

You will see that the color has been changed on the second span, but the transform property has not. Could anyone explain why this is the case?

答:
 by default has display: inline and you need display:block or display:inline-block for transform to take effect.

p span:nth-of-type(2) {
  display: inline-block;
  transform: rotateX( 180deg);
  color: blue
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><p>
  <span> A </span>
  <span> A </span>
  <span> A </span>
</p></code>```

ContentLicense: CC BY-SA 4.0

Body:
Consider the following HTML:

   A
   A
   A

Now try applying this CSS on it:

p span:nth-of-type(2) {transform: rotateX( 180deg ) ; color: blue }

You will see that the color has been changed on the second span, but the transform property has not. Could anyone explain why this is the case?

Body:
<span> by default has display: inline and you need display:block or display:inline-block for transform to take effect.

p span:nth-of-type(2) {
  display: inline-block;
  transform: rotateX( 180deg);
  color: blue
}

<p>
  <span> A </span>
  <span> A </span>
  <span> A </span>
</p>


问:
Problem sending mail with javamail
I'm trying to send an email to myself using the javamail api.  I've followed the code correctly that I found online but I can't seem to get it to work.  The error I'm getting is:

```<code>Exception in thread "main" javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client
</code>```

Does that mean my computer doesn't support authentication?

```<code>public class Emails
{
    public static void main(String[] args) throws MessagingException
    {
        Emails e = new Emails();
        e.sendMail();
    }

    public void sendMail() throws MessagingException
    {
        boolean debug = false;
        String subject = "Testing";
        String message = "Testing Message";
        String from = "myemail@email.com";
        String[] recipients = {"myemail@email.com"};

        // create some properties and get the default Session
        Session session = getSession();
        session.setDebug(debug);

        // create a message
        Message msg = new MimeMessage(session);

        // set the from and to address
        InternetAddress addressFrom = new InternetAddress(from);
        msg.setFrom(addressFrom);

        InternetAddress[] addressTo = new InternetAddress[recipients.length];
        for (int i = 0; i < recipients.length; i++)
        {
            addressTo[i] = new InternetAddress(recipients[i]);
        }
        msg.setRecipients(Message.RecipientType.TO, addressTo);

        // Optional : You can also set your custom headers in the Email if you Want
        msg.addHeader("MyHeaderName", "myHeaderValue");

        // Setting the Subject and Content Type
        msg.setSubject(subject);
        msg.setContent(message, "text/plain");
        Transport.send(msg);
    }

    private Session getSession()
    {
        Authenticator authenticator = new Authenticator();

        Properties properties = new Properties();
        properties.setProperty("mail.smtp.submitter", authenticator.getPasswordAuthentication().getUserName());
        properties.setProperty("mail.smtp.auth", "true");

        properties.setProperty("mail.smtp.host", "smtp.examplehost.com");
        properties.setProperty("mail.smtp.port", "25");

        return Session.getInstance(properties, authenticator);
    }

    private class Authenticator extends javax.mail.Authenticator
    {
        private PasswordAuthentication authentication;

        public Authenticator()
        {
            String username = "myusername";
            String password = "mypassword";
            authentication = new PasswordAuthentication(username, password);
        }

        protected PasswordAuthentication getPasswordAuthentication()
        {
            return authentication;
        }
    }
}
</code>```

When I send emails from this server, what I have to do is, login via ssh to the server (login.server.com etc.) then I can send emails from the mail server (smtp.server.com etc.).  I need to mimic this in java

RESOLVED:  Use the SMTPSSLTransport class

答: This is probably you knock to wrong port. I suppose you're using IMAP protocol: For IMAP over SSL you have to connect to Port 993</p>

ContentLicense: CC BY-SA 3.0

Title: Problem sending mail with javamail

Body:
I'm trying to send an email to myself using the javamail api.  I've followed the code correctly that I found online but I can't seem to get it to work.  The error I'm getting is:

Exception in thread "main" javax.mail.AuthenticationFailedException: No authentication mechansims supported by both server and client

Does that mean my computer doesn't support authentication?

public class Emails
{
    public static void main(String[] args) throws MessagingException
    {
        Emails e = new Emails();
        e.sendMail();
    }

    public void sendMail() throws MessagingException
    {
        boolean debug = false;
        String subject = "Testing";
        String message = "Testing Message";
        String from = "myemail@email.com";
        String[] recipients = {"myemail@email.com"};

        // create some properties and get the default Session
        Session session = getSession();
        session.setDebug(debug);

        // create a message
        Message msg = new MimeMessage(session);

        // set the from and to address
        InternetAddress addressFrom = new InternetAddress(from);
        msg.setFrom(addressFrom);

        InternetAddress[] addressTo = new InternetAddress[recipients.length];
        for (int i = 0; i < recipients.length; i++)
        {
            addressTo[i] = new InternetAddress(recipients[i]);
        }
        msg.setRecipients(Message.RecipientType.TO, addressTo);

        // Optional : You can also set your custom headers in the Email if you Want
        msg.addHeader("MyHeaderName", "myHeaderValue");

        // Setting the Subject and Content Type
        msg.setSubject(subject);
        msg.setContent(message, "text/plain");
        Transport.send(msg);
    }

    private Session getSession()
    {
        Authenticator authenticator = new Authenticator();

        Properties properties = new Properties();
        properties.setProperty("mail.smtp.submitter", authenticator.getPasswordAuthentication().getUserName());
        properties.setProperty("mail.smtp.auth", "true");

        properties.setProperty("mail.smtp.host", "smtp.examplehost.com");
        properties.setProperty("mail.smtp.port", "25");

        return Session.getInstance(properties, authenticator);
    }

    private class Authenticator extends javax.mail.Authenticator
    {
        private PasswordAuthentication authentication;

        public Authenticator()
        {
            String username = "myusername";
            String password = "mypassword";
            authentication = new PasswordAuthentication(username, password);
        }

        protected PasswordAuthentication getPasswordAuthentication()
        {
            return authentication;
        }
    }
}

When I send emails from this server, what I have to do is, login via ssh to the server (login.server.com etc.) then I can send emails from the mail server (smtp.server.com etc.).  I need to mimic this in java

RESOLVED:  Use the SMTPSSLTransport class


问:
how create directory from multiple parts of file name
We have recently exported patient records from our old EMR system, trouble is every note for every patient came out as it's own PDF file resulting in 876,000+ PDFs in one directory, all with a long, cumbersome file name format of ID#-record#.YYYY-MM-DD HH.MM.SS.FIRSTNAME LASTNAME.TYPE OF NOTE.pdf

My first goal is to get to get all the files into patient directories labeled by ID# FIRSTNAME LASTNAME

ie: for the file labeled

345-1.2011-02-3 08.59.53.JOHN DOE.General Miscellaneous Service.pdf
```

<p>a directory called <code>345-JOHN DOE</code> would be created and any files that start with <code>345</code> would be put into it.</p>

<p>I know I can use a script like</p>

```for file in ./*_???ILN*; do
    dir=${file%ILN*}
    dir=${dir##*_}
    mkdir -p "./$dir" &&
    mv -iv "$file" "./$dir"
done

```

Which in this example would take the value between the _ and ILN and create a directory on just that value. But how, if possible, can I take the ID# value and the FIRSTNAME LASTNAME value to create a directory?

答:
You could use a regex like this:

```<code>for i in *.pdf; do
    if [[ "$i" =~ ^([0-9]+)-[0-9]+\.[0-9]{4}-[0-9]{2}-[0-9]{1,2}\ [0-9]{2}\.[0-9]{2}\.[0-9]{2}\.([^.]+)\. ]]; then
        id="${BASH_REMATCH[1]}"
        name="${BASH_REMATCH[2]}"
        subdir="$id-$name"
        mkdir -p -- "$subdir"
        mv -- "$i" "$subdir"
    else
        echo "couldn't parse file name: $i" >&2
    fi
done
</code>```

Bash (since version 3) supports the =~ (regex match) operator in [[ ]], which places the substrings captured by ( ) groups in the BASH_REMATCH array. This is very convenient for extracting information from formatted strings.

Note that this will effectively group files by their ID/name combination, not just ID. This means if you have files that have the same ID, but a different name, they will be put in different subdirectories.

Body:
We have recently exported patient records from our old EMR system, trouble is every note for every patient came out as it's own PDF file resulting in 876,000+ PDFs in one directory, all with a long, cumbersome file name format of ID#-record#.YYYY-MM-DD HH.MM.SS.FIRSTNAME LASTNAME.TYPE OF NOTE.pdf

My first goal is to get to get all the files into patient directories labeled by ID# FIRSTNAME LASTNAME

ie: for the file labeled

345-1.2011-02-3 08.59.53.JOHN DOE.General Miscellaneous Service.pdf

a directory called 345-JOHN DOE would be created and any files that start with 345 would be put into it.

I know I can use a script like

for file in ./*_???ILN*; do
    dir=${file%ILN*}
    dir=${dir##*_}
    mkdir -p "./$dir" &&
    mv -iv "$file" "./$dir"
done

Which in this example would take the value between the _ and ILN and create a directory on just that value. But how, if possible, can I take the ID# value and the FIRSTNAME LASTNAME value to create a directory?

Body:
You could use a regex like this:

for i in *.pdf; do
    if [[ "$i" =~ ^([0-9]+)-[0-9]+\.[0-9]{4}-[0-9]{2}-[0-9]{1,2}\ [0-9]{2}\.[0-9]{2}\.[0-9]{2}\.([^.]+)\. ]]; then
        id="${BASH_REMATCH[1]}"
        name="${BASH_REMATCH[2]}"
        subdir="$id-$name"
        mkdir -p -- "$subdir"
        mv -- "$i" "$subdir"
    else
        echo "couldn't parse file name: $i" >&2
    fi
done

Bash (since version 3) supports the =~ (regex match) operator in [[ ]], which places the substrings captured by ( ) groups in the BASH_REMATCH array. This is very convenient for extracting information from formatted strings.

Note that this will effectively group files by their ID/name combination, not just ID. This means if you have files that have the same ID, but a different name, they will be put in different subdirectories.


问:
Bootstrap 4 - empty row (initially) needs to have a height
I have this style:

```<code>    #cytoscape-container {
        width: 100%;
        height: 100%;
        margin: 0 auto;
        /*border: 1px solid red;*/
    }

    .cytoscape-parent {
        height: 800px;
        width: 100%;
    }
</code>```

That goes with this HTML:

```<code><div class="container mt-5">
    <div class="row">
        <div class="col-xs-12">
            <button class="btn btn-success" type="button" onclick="displayAll()">Draw All</button>
            <button class="btn btn-danger" type="button" onclick="clearAll()">Clear</button>
        </div>
    </div>
    <div class="row" >
        <div class="col-xs-12 cytoscape-parent" >
            <div class="w-100 h-100 d-inline-block" id="cytoscape-container"></div>
        </div>
    </div>
</div>
</code>```

The second row gets a Cytoscape js graph drawn into it when a button is clicked.  However, if I don't set the .cytoscape-parent height to something like height: xxxpx; The row height is always 1 and my diagram does not get drawn.  How can I set it to a percentage of the browser window height (like 90%)?

The #cytoscape-container size is 100% of whatever the .cytoscape-parent is, which is what I want, but I want to set the parent as a %age of the browser window height...

答:
function displayAll() {}
function clearAll() {}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>#cytoscape-container {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  background: yellow;
}

.cytoscape-parent {
  height: 80vh;
  width: 100%;
  background: blue;
}</code>```

      <button class="btn btn-success" type="button" onclick="displayAll()">Draw All</button>
      <button class="btn btn-danger" type="button" onclick="clearAll()">Clear</button>

```

Body:
I have this style:

    #cytoscape-container {
        width: 100%;
        height: 100%;
        margin: 0 auto;
        /*border: 1px solid red;*/
    }

    .cytoscape-parent {
        height: 800px;
        width: 100%;
    }

That goes with this HTML:

            <button class="btn btn-success" type="button" onclick="displayAll()">Draw All</button>
            <button class="btn btn-danger" type="button" onclick="clearAll()">Clear</button>

The second row gets a Cytoscape js graph drawn into it when a button is clicked.  However, if I don't set the .cytoscape-parent height to something like height: xxxpx; The row height is always 1 and my diagram does not get drawn.  How can I set it to a percentage of the browser window height (like 90%)?

The #cytoscape-container size is 100% of whatever the .cytoscape-parent is, which is what I want, but I want to set the parent as a %age of the browser window height...

Body:
function displayAll() {}
function clearAll() {}

#cytoscape-container {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  background: yellow;
}

.cytoscape-parent {
  height: 80vh;
  width: 100%;
  background: blue;
}

<div class="container mt-5">
  <div class="row">
    <div class="col-xs-12">
      <button class="btn btn-success" type="button" onclick="displayAll()">Draw All</button>
      <button class="btn btn-danger" type="button" onclick="clearAll()">Clear</button>
    </div>
  </div>
  <div class="row">
    <div class="col-xs-12 cytoscape-parent">
      <div class="w-100 h-100 d-inline-block" id="cytoscape-container"></div>
    </div>
  </div>
</div>


问:
Using regex to find substring inside another substring
Using regex, how would one check for ANY portion of a string (substring) within another string(substring)?
For example:

```<code>str1 = "li_xxxyyy"
str2 = "123xxxyyy"
</code>```

I need a true response for the xxxyyy variable portion of the string.

I'm looking for any portion of str1 found in any portion of str2

答:
So again, any portion of str1 found in any portion of str2

You don't need regex tbh, it would be simpler and faster to just use regular string operations:

let shareCommonSubstring = (str1, str2) => [...str2].some(c2 => str1.includes(c2));

let test = (str1, str2) => console.log(str1, str2, shareCommonSubstring(str1, str2));
test('xyz', 'abc'); // false
test('xyz', 'abcx'); // true
test('axyz', 'abc'); // true```
</div>
</div>
</p>

<p>But if you insist on regex:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>let shareCommonSubstring = (str1, str2) => !!str1.match(new RegExp(`[${str2}]`));

let test = (str1, str2) => console.log(str1, str2, shareCommonSubstring(str1, str2));
test('xyz', 'abc'); // false
test('xyz', 'abcx'); // true
test('axyz', 'abc'); // true</code>```

Body:
Using regex, how would one check for ANY portion of a string (substring) within another string(substring)?
For example:

str1 = "li_xxxyyy"
str2 = "123xxxyyy"

I need a true response for the xxxyyy variable portion of the string.

I'm looking for any portion of str1 found in any portion of str2

Body:
So again, any portion of str1 found in any portion of str2

You don't need regex tbh, it would be simpler and faster to just use regular string operations:

let shareCommonSubstring = (str1, str2) => [...str2].some(c2 => str1.includes(c2));

let test = (str1, str2) => console.log(str1, str2, shareCommonSubstring(str1, str2));
test('xyz', 'abc'); // false
test('xyz', 'abcx'); // true
test('axyz', 'abc'); // true

But if you insist on regex:

let shareCommonSubstring = (str1, str2) => !!str1.match(new RegExp(`[${str2}]`));

let test = (str1, str2) => console.log(str1, str2, shareCommonSubstring(str1, str2));
test('xyz', 'abc'); // false
test('xyz', 'abcx'); // true
test('axyz', 'abc'); // true


问:
Template function as a template argument
I've just got confused how to implement something in a generic way in C++. It's a bit convoluted, so let me explain step by step.

Consider such code:

```<code>void a(int) {
    // do something
}
void b(int) {
    // something else
}

void function1() {
    a(123);
    a(456);
}
void function2() {
    b(123);
    b(456);
}

void test() {
    function1();
    function2();
}
</code>```

It's easily noticable that function1 and function2 do the same, with the only different part being the internal function.

Therefore, I want to make function generic to avoid code redundancy. I can do it using function pointers or templates. Let me choose the latter for now. My thinking is that it's better since the compiler will surely be able to inline the functions - am I correct? Can compilers still inline the calls if they are made via function pointers? This is a side-question.

OK, back to the original point... A solution with templates:

```<code>void a(int) {
    // do something
}
void b(int) {
    // something else
}

template<void (*param)(int) >
void function() {
    param(123);
    param(456);
}

void test() {
    function<a>();
    function<b>();
}
</code>```

All OK. But I'm running into a problem: Can I still do that if a and b are generics themselves?

```<code>template<typename T>
void a(T t) {
   // do something
}

template<typename T>
void b(T t) {
   // something else
}

template< ...param... > // ???
void function() {
    param<SomeType>(someobj);
    param<AnotherType>(someotherobj);
}

void test() {
    function<a>();
    function<b>();
}
</code>```

I know that a template parameter can be one of:

a type,

a template type,

a value of a type.

None of those seems to cover my situation. My main question is hence: How do I solve that, i.e. define  function() in the last example?

(Yes, function pointers seem to be a workaround in this exact case - provided they can also be inlined - but I'm looking for a general solution for this class of problems).

答:
With generic lambda from C++14 you might do:

```<code>template<typename T> void a(T t) { /* do something */}
template<typename T> void b(T t) { /* something else */ }

template <typename F>
void function(F&& f) {
    f(someobj);
    f(someotherobj);
}

void test() {
    // For simple cases, auto&& is even probably auto or const auto&
    function([](auto&& t){ a(t); });
    function([](auto&& t){ b(t); });

    // For perfect forwarding
    function([](auto&& t){ a(std::forward<decltype(t)>(t)); });
    function([](auto&& t){ b(std::forward<decltype(t)>(t)); });
}
</code>```

Can compilers still inline the calls if they are made via function pointers?

They can, but it is indeed more complicated, and they may fail more often than with functor or template.

ContentLicense: CC BY-SA 2.5

Body:
I've just got confused how to implement something in a generic way in C++. It's a bit convoluted, so let me explain step by step.

Consider such code:

void a(int) {
    // do something
}
void b(int) {
    // something else
}

void function1() {
    a(123);
    a(456);
}
void function2() {
    b(123);
    b(456);
}

void test() {
    function1();
    function2();
}

It's easily noticable that function1 and function2 do the same, with the only different part being the internal function.

Therefore, I want to make function generic to avoid code redundancy. I can do it using function pointers or templates. Let me choose the latter for now. My thinking is that it's better since the compiler will surely be able to inline the functions - am I correct? Can compilers still inline the calls if they are made via function pointers? This is a side-question.

OK, back to the original point... A solution with templates:

void a(int) {
    // do something
}
void b(int) {
    // something else
}

template<void (*param)(int) >
void function() {
    param(123);
    param(456);
}

void test() {
    function();
    function();
}

All OK. But I'm running into a problem: Can I still do that if a and b are generics themselves?

template<typename T>
void a(T t) {
   // do something
}

template<typename T>
void b(T t) {
   // something else
}

template< ...param... > // ???
void function() {
    param<SomeType>(someobj);
    param<AnotherType>(someotherobj);
}

void test() {
    function();
    function();
}

I know that a template parameter can be one of:

a type,

a template type,

a value of a type.

None of those seems to cover my situation. My main question is hence: How do I solve that, i.e. define  function() in the last example?

(Yes, function pointers seem to be a workaround in this exact case - provided they can also be inlined - but I'm looking for a general solution for this class of problems).

Body:
With generic lambda from C++14 you might do:

template<typename T> void a(T t) { /* do something */}
template<typename T> void b(T t) { /* something else */ }

template <typename F>
void function(F&& f) {
    f(someobj);
    f(someotherobj);
}

void test() {
    // For simple cases, auto&& is even probably auto or const auto&
    function([](auto&& t){ a(t); });
    function([](auto&& t){ b(t); });

    // For perfect forwarding
    function([](auto&& t){ a(std::forward<decltype(t)>(t)); });
    function([](auto&& t){ b(std::forward<decltype(t)>(t)); });
}

Can compilers still inline the calls if they are made via function pointers?

They can, but it is indeed more complicated, and they may fail more often than with functor or template.


问:
C pointer problem!
Why does the following C code does not ouput 10

```<code>#include<stdio.h>
#include<stdlib.h>
void get_length(char s[]);
int main( )
{
char buff[128];
printf("\nEnter buffer data: ");
scanf("%s",buff);
get_length(buff);
}

void get_length(char *s){
    int count;
for(count = 0 ; *s != '\0' ; s++)
    count++;
printf("count = %d\n",count);
}
</code>```

The input is I am Rohit

The output is

count = 432

Can anyone please explain that.

答:
I think you meant %s, not 5s.

BTW, value-initialising your array (char buff[128] = {}) will prevent your array from being unbounded (count = 432 is arbitrary for you).

You should then check for *s != '\0', not \n, in get_length — C-style strings are bounded by the NULL character (\0), not newlines, regardless that you took the data from user input. The newline is lost from that input.

Title: C pointer problem!

Body:
Why does the following C code does not ouput 10

#include<stdio.h>
#include<stdlib.h>
void get_length(char s[]);
int main( )
{
char buff[128];
printf("\nEnter buffer data: ");
scanf("%s",buff);
get_length(buff);
}

void get_length(char *s){
    int count;
for(count = 0 ; *s != '\0' ; s++)
    count++;
printf("count = %d\n",count);
}

The input is I am Rohit

The output is

count = 432

Can anyone please explain that.


问:
Is there a way to remove abilities to delete/modify documents uploaded to DocuSign on the Sender View?
I am using the DocuSign REST API v2 with the DocuSign Java Client. I am providing a user with the DocuSign Sender view to let them finish the rest, such as adding Signature or change email subject/body. The rule that I want to apply to the Sender view is that a sender should not modify or remove document(s) uploaded to DocuSign on the Sender view but can change the order of documents.
To achieve that, I created a permission set for the sender to restrict some abilities of the Sender View. I couldn't find an option for modifying documents.

Current Permissions set that I am using

The following is the current Sender view that I created with the above permission set. I would like to remove the abilities of the square boxes in red.

The sender view that I am testing

As far as I research, it seems that there is no way to remove abilities to delete/modify documents uploaded to DocuSign on the Sender View. If you have any experiences in terms of this, could you please advise on this?

答: The fact that "Disable Document Upload" still allows the "Replace Document" option is currently being handled as a product issue. I don't have a timeline for resolution, but if you like you can contact your Account Manager to have them add your account's info to the internal ticket for this: MAR-29446</p>


问:
No matching overload function found Error
I am trying to return a vector with template T with data from a file to be searched through in another function.

The program I am working on is a program that stores the name, date of birth, and address that was inputted to the program. I have tried to store the returned vector in another vector with the template type but it keeps on showing:

Error   C2672    'getDataToVector': no matching overloaded function found

Error   C2783    'std::vector> getDataToVector(std::ifstream)': could not deduce template argument for 'T'

template <class T>
void searchData(vector<string>& name, vector<int>& birthdate, vector<string>& address) {
    bool found = false;
    string entry;
    string line;
    int i = 0;

    cout << "Please enter the name you want to search: " << endl;
    getline(cin, entry);

    std::ifstream in;
    in.open("test_file.txt");
    vector<T> file_data = getDataToVector(in);

    while (!found) {
        if (std::find(file_data.begin(), file_data.end(), entry) != file_data.end()) {
            cout << "The name is found" << endl;
            cout << file_data[i] << endl;
            found = true;
        }
        i++;
    }

}

template <class T>
vector<T> getDataToVector(std::ifstream infile) {
    vector<T> data;
    string line;

    while (getline(infile, line)) {
        data.push_back(line);
    }
    return data;
}
```

I am a beginner in c++ programming and am very appreciative for any help anyone can give me.

答:
For starters the function getDataToVector if it is not a member function of a class shall be declared before the function searchData because it is referred in the function.

Secondly the parameter of the function shall be a reference

template

```<code>vector<T> getDataToVector(std::ifstream &infile) {
                                       ^^^
</code>```

As the function is a template function and can not deduce the template parameter then you should write

```<code>vector<T> file_data = getDataToVector<T>(in);
                                     ^^^
</code>```

Body:
I am trying to return a vector with template T with data from a file to be searched through in another function.

The program I am working on is a program that stores the name, date of birth, and address that was inputted to the program. I have tried to store the returned vector in another vector with the template type but it keeps on showing:

Error   C2672    'getDataToVector': no matching overloaded function found

Error   C2783    'std::vector> getDataToVector(std::ifstream)': could not deduce template argument for 'T'

template <class T>
void searchData(vector<string>& name, vector<int>& birthdate, vector<string>& address) {
    bool found = false;
    string entry;
    string line;
    int i = 0;

    cout << "Please enter the name you want to search: " << endl;
    getline(cin, entry);

    std::ifstream in;
    in.open("test_file.txt");
    vector<T> file_data = getDataToVector(in);

    while (!found) {
        if (std::find(file_data.begin(), file_data.end(), entry) != file_data.end()) {
            cout << "The name is found" << endl;
            cout << file_data[i] << endl;
            found = true;
        }
        i++;
    }

}

template <class T>
vector<T> getDataToVector(std::ifstream infile) {
    vector<T> data;
    string line;

    while (getline(infile, line)) {
        data.push_back(line);
    }
    return data;
}

I am a beginner in c++ programming and am very appreciative for any help anyone can give me.

Body:
For starters the function getDataToVector if it is not a member function of a class shall be declared before the function searchData because it is referred in the function.

Secondly the parameter of the function shall be a reference

template

vector<T> getDataToVector(std::ifstream &infile) {
                                       ^^^

As the function is a template function and can not deduce the template parameter then you should write

vector<T> file_data = getDataToVector<T>(in);
                                     ^^^


答:
In reference to this post, span is an inline element and the transform property will not work unless you use "display:block;", or in your case "display:inline-block;"

Change your css to this:

```<code>p span:nth-of-type(2){
  display: inline-block;
  transform: rotateX(180deg);
  color: blue;
}
</code>```

Title: CSS transform does not get applied on elements selected by :nth-child()

Body:
In reference to this post, span is an inline element and the transform property will not work unless you use "display:block;", or in your case "display:inline-block;"

Change your css to this:

p span:nth-of-type(2){
  display: inline-block;
  transform: rotateX(180deg);
  color: blue;
}


问:
How to implement OpenXml GradientFill in vb.net
I am not suceeding in translating into vb.net some code which works in c#.

The code is from StackOverflow article:
How to use a gradient fill (GradientFill) with ClosedXML

I can get most of it correctly except this:

```<code> GradientFill gradientFill = new GradientFill() { Degree = 354 };
    gradientFill.Append(new GradientStop() { Position = 0D, Color = new Color() { Rgb = "FF00FF00" } });
    gradientFill.Append(new GradientStop() { Position = 0.49D, Color = new Color() { Rgb = "FF00FF00" } });
    gradientFill.Append(new GradientStop() { Position = 0.51D, Color = new Color() { Rgb = "FFFFFFFF" } });
    gradientFill.Append(new GradientStop() { Position = 1D, Color = new Color() { Rgb = "FFFFFFFF" } });
</code>```

Any help would be super apreciated!

答:
You need a With and a . to do that in VB.NET, e.g.

```<code>Dim myGradientFill As New GradientFill() With {.Degree = 354}
myGradientFill.Append(New GradientStop() With {.Position = 0D, .Color = New Color() With {.Rgb = "FF00FF00"}})
</code>```

Body:
I am not suceeding in translating into vb.net some code which works in c#.

The code is from StackOverflow article:
How to use a gradient fill (GradientFill) with ClosedXML

I can get most of it correctly except this:

 GradientFill gradientFill = new GradientFill() { Degree = 354 };
    gradientFill.Append(new GradientStop() { Position = 0D, Color = new Color() { Rgb = "FF00FF00" } });
    gradientFill.Append(new GradientStop() { Position = 0.49D, Color = new Color() { Rgb = "FF00FF00" } });
    gradientFill.Append(new GradientStop() { Position = 0.51D, Color = new Color() { Rgb = "FFFFFFFF" } });
    gradientFill.Append(new GradientStop() { Position = 1D, Color = new Color() { Rgb = "FFFFFFFF" } });

Any help would be super apreciated!

Body:
You need a With and a . to do that in VB.NET, e.g.

Dim myGradientFill As New GradientFill() With {.Degree = 354}
myGradientFill.Append(New GradientStop() With {.Position = 0D, .Color = New Color() With {.Rgb = "FF00FF00"}})


问:
Access Denied fro user 'root@localhost' on centos 7
I am a newbie to CentOS .

I want to setup Mysqlfabric with multiple mysql servers in a single machine.

First i want to setup the Mysql instances.
The following steps followed but i could not start the single mysql server instance.

step 1. Fresh installation of centos 7

setp 2. Added the required Yum repository for mysql-community-server.version.noarch.rpm.

setp 3. Installed yum mysql-community-server
          (The mysql version is 5.7.10 installed.)

step 4. Checked the mysqld status with systemctl status mysqld.

step 5. systemctl start mysqld.services

step 6. now i want to check mysql shell.

step 7. I had checked the mysql client also it is already installed while mysql commuinty server has installed.

step 8. For the mysql root user not prompted the password so i had tried with the default password . like mysql -u root -p mysql

```<code>It is asking Enter password .
tried with different password but i am getting the error like
ERROR 1045 (28000) : Access denied for user 'root'@'localhost' (using password: YES).
Another way also tried with mysql_secure_installation but i am getting the same error. i dont know how to resolve this.
Mysqladmin -u root password = 'newpassword' also tried. But i am getting the access denied error.
</code>```

The root password not yet set up but access denied. i dont know how to resolve this . Please help me to resolve. Thanks in advance.

After first instance successfully running only i can proceed with multiple instances and need to configure mysqlfabric. Please help me.

I had referred the mysql installation link
http://sharadchhetri.com/2014/07/31/how-to-install-mysql-server-5-6-on-centos-7-rhel-7/

答:
Stop MySQL:

systemctl stop mysqld

Set the mySQL environment option

systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"

Start MySQL using the options you just set

systemctl start mysqld

Login as root without a password

mysql -u root

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

Stop MySQL

systemctl stop mysqld

Unset the MySQL environment option so it starts normally next time

systemctl unset-environment MYSQLD_OPTS

Start MySQL normally:

systemctl start mysqld

Try to login using your new password:

mysql -u root -p

Body:
I am a newbie to CentOS .

I want to setup Mysqlfabric with multiple mysql servers in a single machine.

First i want to setup the Mysql instances.
The following steps followed but i could not start the single mysql server instance.

step 1. Fresh installation of centos 7

setp 2. Added the required Yum repository for mysql-community-server.version.noarch.rpm.

setp 3. Installed yum mysql-community-server
          (The mysql version is 5.7.10 installed.)

step 4. Checked the mysqld status with systemctl status mysqld.

step 5. systemctl start mysqld.services

step 6. now i want to check mysql shell.

step 7. I had checked the mysql client also it is already installed while mysql commuinty server has installed.

step 8. For the mysql root user not prompted the password so i had tried with the default password . like mysql -u root -p mysql

It is asking Enter password .
tried with different password but i am getting the error like
ERROR 1045 (28000) : Access denied for user 'root'@'localhost' (using password: YES).
Another way also tried with mysql_secure_installation but i am getting the same error. i dont know how to resolve this.
Mysqladmin -u root password = 'newpassword' also tried. But i am getting the access denied error.

The root password not yet set up but access denied. i dont know how to resolve this . Please help me to resolve. Thanks in advance.

After first instance successfully running only i can proceed with multiple instances and need to configure mysqlfabric. Please help me.

I had referred the mysql installation link
http://sharadchhetri.com/2014/07/31/how-to-install-mysql-server-5-6-on-centos-7-rhel-7/


Title: Regex - match up to next match

Body:
I would like to iterate matches over a text, the blocks I want to match start with a number then a tab character.

My beginning match is ^\d+\t, but is there a way to indicate that I want all text including this match up until the next match?

Input data:

1       111.111.111.111
111.111.111.111
                    Host IP     111.111.111.111
111.111.111.111
111.111.111.111         Host IP     TCP             app     11111, 11111, 11111, 11111      Allow
2       111.111.111.111
111.111.111.111
111.111.111.111         Host IP     111.111.111.111
111.111.111.111         Host IP     TCP             app     11111, 11111, 11111, 11111      Allow
3       111.111.111.111
111.111.111.111         Host IP     111.111.111.111
111.111.111.111
111.111.111.111
111.111.111.111         Host IP     TCP             app     11111, 11111, 11111, 11111      Allow
4       111.111.111.111
111.111.111.111
111.111.111.111
111.111.111.111         Host IP     111.111.111.111
111.111.111.111         Host IP     TCP             app     11111, 11111, 11111, 11111      Allow

I'm using Perl.

Body:
Probably, this?

/^\d+\t.*?(?:\z|^\d+\t)/ms