在Windows 7上编译x64体系结构时出现“致命错误C1083:无法打开包含文件”

时间:2013-07-14 17:46:41

标签: c++ boost visual-studio-2012 64-bit

我在使用Visual Studio 2012 Pro尝试使用boost编译简单示例时遇到了问题。我已成功下载并编译了boost(版本1.54.0)。我在发布和调试版本中编译了32位版本(Win32配置)的示例。然后我尝试构建64位(因为我有64位Windows 7)。我按照这里的说明进行了操作:How to: Configure Visual C++ Projects to Target 64-Bit Platforms。唉,编译尝试失败了,错误:

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

我检查了以下几点,现在我认为可能出错了:

  1. 文件位置正确(确切位置:C:\ dev \ include \ boost \ boost \ aligned_storage.hpp)。如果它不存在那么Win32版本将不会编译。
  2. 我已将环境变量INCLUDE设置为“C:\ dev / include; C:\ dev / include / boost”。
  3. “VC ++目录 - >包含目录”如下所示:
  4.   

    $(VCInstallDir)包括; $(VCInstallDir)atlmfc \包括; $(WindowsSDK_IncludePath); $(包含);

    1. “C / C ++ - >一般 - >其他包含目录”,如下所示:
    2.   

      C:\ dev的\包括\升压;%(AdditionalIncludeDirectories)

      我正在尝试编译的代码(当然这只是其中的一部分):

      //
      // 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 <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;
      

      我的x64 \ Debug \ BoostExample.log的内容:

      Build started 2013-07-15 19:45:53.
       1>Project "C:\Users\LF\Develop\BoostExample\BoostExample\BoostExample.vcxproj" on node 2 (Build target(s)).
       1>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>server.cpp(38): fatal error C1083: Cannot open include file: 'boost/aligned_storage.hpp': No such file or directory
       1>Done Building Project "C:\Users\LF\Develop\BoostExample\BoostExample\BoostExample.vcxproj" (Build target(s)) -- FAILED.
      
      Build FAILED.
      
      Time Elapsed 00:00:00.28
      

      为了比较,这里是Release \ BoostExample.log(用于成功的32位编译):

      Build started 2013-07-15 20:06:17.
       1>Project "C:\Users\LF\Develop\BoostExample\BoostExample\BoostExample.vcxproj" on node 2 (Build target(s)).
       1>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 -> C:\Users\LF\Develop\BoostExample\Release\BoostExample.exe
       1>Done Building Project "C:\Users\LF\Develop\BoostExample\BoostExample\BoostExample.vcxproj" (Build target(s)).
      
      Build succeeded.
      
      Time Elapsed 00:00:02.50
      

      任何帮助将不胜感激:D。

      提前致谢左湖

0 个答案:

没有答案