title: Error : LNK1104 cannot open file 'pthread.lib'
body: <p>I am trying to compile a native Linux C++ application in Windows using Visual Studio 2017. The app uses WebRtc's Acoustic Echo Cancellation(AEC) APIs to negate echo on wav files. Following is the CmakeLists.txt file:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  project(wav-aec)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  add_subdirectory(gflags)
  add_definitions("-DWEBRTC_NS_FLOAT -DWEBRTC_WIN -DNOMINMAX")
  
  #-DWEBRTC_UNTRUSTED_DELAY -DWEBRTC_LINUX -DWEBRTC_POSIX 
  
  include_directories(
      webrtc
      webrtc/webrtc/common_audio/signal_processing/include
      webrtc/webrtc/modules/audio_coding/codecs/isac/main/include
  )
  
  set(WEBRTC_SRC_
      base/buffer.cc
      base/checks.cc
      ...
      ...
      #system_wrappers/source/rw_lock_posix.cc
      system_wrappers/source/trace_impl.cc
      #system_wrappers/source/trace_posix.cc
  )
  
  function(prepend_path var prefix)
     set(listVar "")
     foreach(f ${ARGN})
        list(APPEND listVar "${prefix}/${f}")
     endforeach(f)
     set(${var} "${listVar}" PARENT_SCOPE)
  endfunction(prepend_path)
  
  prepend_path(WEBRTC_SRC webrtc/webrtc ${WEBRTC_SRC_})
  
  add_executable(webrtc-audioproc webrtc-audioproc.cpp ${WEBRTC_SRC})
  target_link_libraries(webrtc-audioproc gflags pthread)
  </code></pre>
  
  <p>When I try to build it, I get the following errror:
  <strong>Error : LNK1104 cannot open file 'pthread.lib'</strong></p>
  
  <p>Here is the link to the only linux dependent source file(cpp) of the project:
  <a href="https://github.com/lschilli/wav-aec/blob/master/webrtc-audioproc.cpp" rel="nofollow noreferrer">https://github.com/lschilli/wav-aec/blob/master/webrtc-audioproc.cpp</a></p>
  
  <p>What will be the right approach to port the code from Linux to windows?
  Whats is Windows equivalent of gflags and pthread? And what necessary changes needs to go to CmakeLists.txt?</p>
  
  <p>P.S: I have already added pthread header, dll and libs to Visual Studio directory manually.</p>