title: Can I use tensorflow c++ library (compiled in vs2019) in vs2015?
body: <p>I recently try to use tensorflow c++ to speed up my model in C application. I used <a href="https://github.com/Dobiasd/frugally-deep" rel="nofollow noreferrer">fragguly-deep</a> in my project. But my company was not satisfied with the speed. I tried to compile tensorflow in c++ to apply gpu acceleration but I failed during bazel build.</p>
  <pre><code>ERROR: C:/users/user/_bazel_user/sd7zocps/external/com_google_protobuf/BUILD:155:11: C++ compilation of rule '@com_google_protobuf//:protobuf' failed (Exit -1): python.exe failed: error executing command
    cd C:/users/user/_bazel_user/sd7zocps/execroot/org_tensorflow
    SET CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.2
      SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt;
      SET LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64;
      SET PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\MSBuild\14.0\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\;;C:\Windows\system32
      SET PWD=/proc/self/cwd
      SET PYTHON_BIN_PATH=C:/ProgramData/Anaconda3/python.exe
      SET PYTHON_LIB_PATH=C:/ProgramData/Anaconda3/lib/site-packages
      SET RUNFILES_MANIFEST_ONLY=1
      SET TEMP=C:\Users\User\AppData\Local\Temp
      SET TF2_BEHAVIOR=1
      SET TF_CUDA_COMPUTE_CAPABILITIES=8.6
      SET TMP=C:\Users\User\AppData\Local\Temp
    C:/ProgramData/Anaconda3/python.exe -B external/local_config_cuda/crosstool/windows/msvc_wrapper_for_nvcc.py /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0600 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS /bigobj /Zm500 /J /Gy /GF /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /Iexternal/com_google_protobuf /Ibazel-out/x64_windows-opt/bin/external/com_google_protobuf /Iexternal/com_google_protobuf/src /Ibazel-out/x64_windows-opt/bin/external/com_google_protobuf/src /showIncludes /MD /O2 /DNDEBUG /W0 /D_USE_MATH_DEFINES -DWIN32_LEAN_AND_MEAN -DNOGDI /experimental:preprocessor /d2ReducedOptimizeHugeFunctions /arch:AVX /std:c++14 /DHAVE_PTHREAD /wd4018 /wd4065 /wd4146 /wd4244 /wd4251 /wd4267 /wd4305 /wd4307 /wd4309 /wd4334 /wd4355 /wd4506 /wd4514 /wd4800 /wd4996 /Fobazel-out/x64_windows-opt/bin/external/com_google_protobuf/_objs/protobuf/printer.obj /c external/com_google_protobuf/src/google/protobuf/io/printer.cc
  Execution platform: @local_execution_config_platform//:platform
  Target //tensorflow/tools/pip_package:build_pip_package failed to build
  INFO: Elapsed time: 11.077s, Critical Path: 1.69s
  INFO: 30 processes: 30 internal.
  FAILED: Build did NOT complete successfully
  </code></pre>
  <p>I thought that was caused by vs version. My company is using vs 2015 but <a href="https://www.tensorflow.org/install/source_windows" rel="nofollow noreferrer">tensorflow offically said it should be compiled with vs 2019</a>. So my question is if I can use tensorflow compiled in vs 2019 in vs 2015. Or actually that is not the problem.
  Thanks.</p>