title: "fatal error C1083: Cannot open include file" while compiling for x64 architecture on Windows 7
body: <p>I have encountered a problem while trying to compile simple example with boost using Visual Studio 2012 Pro. I have downloaded and compiled boost succesfully (ver 1.54.0). I have compiled 32 bit version (Win32 configuration) of example in both release and debug version. Then I made an attempt to build for 64 bit (as I have 64 bit Windows 7). I followed the instruction here: <a href="http://msdn.microsoft.com/en-us/library/vstudio/9yb4317s.aspx" rel="nofollow">How to: Configure Visual C++ Projects to Target 64-Bit Platforms</a>. Alas, the compilation attempt failed with error:</p>
  
  <pre><code>1&gt;server.cpp(38): fatal error C1083: Cannot open include file: 'boost/aligned_storage.hpp': No such file or directory
  </code></pre>
  
  <p>I checked the following points and now I'm out of ideas what could be wrong:</p>
  
  <ol>
  <li>The file is in correct place (exact location: C:\dev\include\boost\boost\aligned_storage.hpp). If it hadn't been there then the Win32 version wouldn't have compiled.</li>
  <li>I have set the environment variable INCLUDE as "C:\dev/include;C:\dev/include/boost" .</li>
  <li>"VC++ Directories->Include Directories" looks like this:</li>
  </ol>
  
  <blockquote>
    <p>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);$(INCLUDE);</p>
  </blockquote>
  
  <ol>
  <li>"C/C++ -> General -> Additional Include Directories" like this:</li>
  </ol>
  
  <blockquote>
    <p>C:\dev\include\boost;%(AdditionalIncludeDirectories)</p>
  </blockquote>
  
  <p>The code I'm trying to compile is (this is only part of it of course):</p>
  
  <pre><code>//
  // server.cpp
  // ~~~~~~~~~~
  //
  // Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  //
  // Distributed under the Boost Software License, Version 1.0. (See accompanying
  // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  //
  
  
  #ifndef WINVER                  // Minimum platform is Windows 7
  #define WINVER 0x0601
  #endif
  
  #ifndef _WIN32_WINNT            // Minimum platform is Windows 7
  #define _WIN32_WINNT 0x0601
  #endif
  
  #ifndef _WIN32_WINDOWS          // Minimum platform is Windows 7
  #define _WIN32_WINDOWS 0x0601
  #endif
  
  #include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;boost/aligned_storage.hpp&gt;
  #include &lt;boost/array.hpp&gt;
  #include &lt;boost/bind.hpp&gt;
  #include &lt;boost/enable_shared_from_this.hpp&gt;
  #include &lt;boost/noncopyable.hpp&gt;
  #include &lt;boost/shared_ptr.hpp&gt;
  #include &lt;boost/asio.hpp&gt;
  
  using boost::asio::ip::tcp;
  </code></pre>
  
  <p>Content of my x64\Debug\BoostExample.log:</p>
  
  <pre><code>Build started 2013-07-15 19:45:53.
   1&gt;Project "C:\Users\LF\Develop\BoostExample\BoostExample\BoostExample.vcxproj" on node 2 (Build target(s)).
   1&gt;ClCompile:
       C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\CL.exe /c /Zi /nologo /W3 /WX- /Od /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"x64\Debug\\" /Fd"x64\Debug\vc110.pdb" /Gd /TP /errorReport:prompt server.cpp
       server.cpp
   1&gt;server.cpp(38): fatal error C1083: Cannot open include file: 'boost/aligned_storage.hpp': No such file or directory
   1&gt;Done Building Project "C:\Users\LF\Develop\BoostExample\BoostExample\BoostExample.vcxproj" (Build target(s)) -- FAILED.
  
  Build FAILED.
  
  Time Elapsed 00:00:00.28
  </code></pre>
  
  <p>For comparison here is Release\BoostExample.log (for succesfull 32bit compilation):</p>
  
  <pre><code>Build started 2013-07-15 20:06:17.
   1&gt;Project "C:\Users\LF\Develop\BoostExample\BoostExample\BoostExample.vcxproj" on node 2 (Build target(s)).
   1&gt;ClCompile:
       C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D _MBCS /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\" /Fd"Release\vc110.pdb" /Gd /TP /analyze- /errorReport:prompt server.cpp
       server.cpp
     Link:
       C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\Users\LF\Develop\BoostExample\Release\BoostExample.exe" /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\Users\LF\Develop\BoostExample\Release\BoostExample.pdb" /OPT:REF /OPT:ICF /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\LF\Develop\BoostExample\Release\BoostExample.lib" /MACHINE:X86 /SAFESEH Release\server.obj
       Generating code
       Finished generating code
       BoostExample.vcxproj -&gt; C:\Users\LF\Develop\BoostExample\Release\BoostExample.exe
   1&gt;Done Building Project "C:\Users\LF\Develop\BoostExample\BoostExample\BoostExample.vcxproj" (Build target(s)).
  
  Build succeeded.
  
  Time Elapsed 00:00:02.50
  </code></pre>
  
  <p>Any help will be greatly appreciated :D.</p>
  
  <p>Thanks in advance<br/>Lehu</p>