"fatal error C1083: Cannot open include file" while compiling for x64 architecture on Windows 7

  • Thread starter Thread starter Lehhu
  • Start date Start date
L

Lehhu

Guest
Hi everyone,

I recently installed Visual Studio 2012 Pro and compiled boost library with it (succesfully). Then I decided to compile some example with boost. At first everything went smooth: Win32 compiled both in release and debug version. Unfortunately this was not the case when I tried to compile x64 versions... I got the following error:

1>server.cpp(38): fatal error C1083: Cannot open include file: boost/aligned_storage.hpp: No such file or directory

The things I checked are:

  1. The file is in correct place (exact location: C:\dev\include\boost\boost\aligned_storage.hpp). If it hadnt been there then the Win32 version wouldnt have compiled.
  2. I have set the environment variable INCLUDE as "C:\dev/include;C:\dev/include/boost" .
  3. My "VC++ Directories" looks like this:[Broken External Image]:http://social.msdn.microsoft.com/Forums/getfile/307932while "C/C++ -> General" like this[Broken External Image]:http://social.msdn.microsoft.com/Forums/getfile/307934
  4. I generated the x64 configuration using the instruction here: How to: Configure Visual C++ Projects to Target 64-Bit Platforms .

This is the 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

#ifndef WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN
#endif

#ifndef NOMINMAX // Use the standards templated min/max
#define NOMINMAX
#endif

#ifndef _USE_MATH_DEFINES // We do want PI defined
#define _USE_MATH_DEFINES
#endif

#include <cstdlib>
#include <iostream>
#include <boost/aligned_storage.hpp>
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/asio.hpp>

using boost::asio::ip::tcp;



What did I omit or messed up?

Best regards and thank you in advance
Lehhu

Continue reading...
 
Back
Top