title: How to fix include errors in resulting Visual Studio project from cmake
body: <p><em>Please scroll to the bottom to list the updated short question</em></p>
  
  <p>I am building <a href="http://bugbeebox.com/2012/12/30/building-static-podofo-0-9-1-with-msvc-2012/" rel="nofollow noreferrer">PoDoFo</a>. In the final step, I am using cmake to create the Visual Studio 2010 .sln file for PoDoFo. However when I build this solution file, it can't find header files of dependent libraries. For example, it doesn't find boost library header files.</p>
  
  <pre><code>c:\pdf\podofo-0.9.1\src\base\PdfDefines.h(66): fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory
  </code></pre>
  
  <p>If I disable boost, I get similar error for freetype library headers</p>
  
  <pre><code>2&gt;..\..\src\doc\PdfFontCache.cpp(55): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory
  </code></pre>
  
  <p>Here is my build.cmd file</p>
  
  <pre><code>del cmakecache.txt
  
  set BOOST_ROOT=C:\pdf\boost_1_51_0_code
  set BOOST_INCLUDE_DIR=C:\pdf\boost\boost_1_51_0\staging\include
  set BOOSTLIBDIR=C:\workspace\lib\boost\boost_1_51_0\staging\lib
  
  set FT_INCLUDE=C:\PDF\freetype-2.4.0\include\freetype
  
  
  set FTDIR=C:\PDF\freetype-2.4.0\objs\win32\vc2008
  set JPEGDIR=C:\PDF\jpeg-8d\Release\lib
  set TIFDIR=C:\PDF\tiff-4.0.3\lib
  set ZLIBDIR=C:\pdf\zlib-1.2.8
  
  
  set BUILD_FLAGS="/MT"
  
  cmake  -G "Visual Studio 10" "C:\pdf\podofo-0.9.1" ^
      -DCMAKE_CXX_FLAGS_RELEASE:STRING=%BUILD_FLAGS%  ^
      -DFREETYPE_INCLUDE_DIR=%FT_INCLUDE% ^
      -DLIBJPEG_LIBRARY_RELEASE=jpeg ^
      -DCMAKE_INCLUDE_PATH="%INCLUDE%;%BOOST_INCLUDE_DIR%;%FT_INCLUDE%;%FT_INCLUDE%\freetype;%JPEGDIR%\jpeg;%TIFDIR%\tiff;%ZLIBDIR%\zlib" ^
      -DCMAKE_LIBRARY_PATH="%LIB%;%BOOSTLIBDIR%;%FTDIR%;%JPEGDIR%\lib;%TIFDIR%;%ZLIBDIR%\lib" ^
      -DPODOFO_BUILD_SHARED:BOOL=FALSE ^
      -DPODOFO_BUILD_STATIC:BOOL=TRUE ^
      -DWANT_BOOST:BOOL=0 ^
      -DLIBJPEG_LIBRARY_NAMES_RELEASE=jpeg ^
      -DFREETYPE_LIBRARY_NAMES_RELEASE=freetype240MT ^
      -DZLIB_LIBRARY_NAMES_RELEASE=zlibstat
  </code></pre>
  
  <p>I am new to CMake and I don't understand <em>how the library dependencies carry through to the Visual Studio projects?</em>.</p>
  
  <p>Here is the screen shot of the paths in resulting solution file. I can't understand how these paths carry through from the small script file? They don't exactly correspond to <code>DCMAKE_LIBRARY_PATH</code> so where they come from?</p>
  
  <p><img src="https://i.stack.imgur.com/cyF9y.png" alt="Project paths in visual studio project - what part of script file them come from?"></p>
  
  <p>How can I fix these include errors in the solution file? I tried adding these paths to Project Properites >> VC++ Directories >> 'Include Directories' but it still doesn't want to build. I am afraid even if I eliminate these include errors, I will get linker errors because the library paths are probably incorrect too. How can I fix these error and get the project to build? Thanks.</p>
  
  <p><strong>Updated question</strong></p>
  
  <p>I fixed the include error by changing the path to:</p>
  
  <pre><code>FT_INCLUDE=C:\PDF\freetype-2.4.0\include\
  </code></pre>
  
  <p>Now as I expected, I get lots of linker errors. However I noticed that it did created PoDoFo.lib file so now I took the tast to use this in an example demo. I got that to compile as well successfully but I get the following linker errors:</p>
  
  <pre><code>1&gt;podofo.lib(PdfFont.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
  1&gt;podofo.lib(PdfDifferenceEncoding.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
  1&gt;podofo.lib(PdfFontSimple.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
  1&gt;podofo.lib(PdfIdentityEncoding.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
  1&gt;podofo.lib(PdfFontTrueType.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
  1&gt;podofo.lib(PdfFontMetricsObject.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
  1&gt;podofo.lib(PdfEncodingObjectFactory.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
  </code></pre>
  
  <p>I did made sure the the dependent libraries are added in project settings along with paths but why do I still get these errors?</p>