简体   繁体   English

C ++:如何在VC ++ 6中包含boost库头?

[英]C++ : How to include boost library header in VC++6?

I used this guide to rebuild the boost library in VC++6 under windows XP. 我使用本指南在Windows XP下的VC ++ 6中重建了boost库。 But is having problems trying to include the header files. 但是在尝试包含头文件时遇到了问题。 By default, the boost library makes use of point 1 as follows to declare the header files. 默认情况下,boost库按如下方式使用点1来声明头文件。 But if I used point 1, I get "fatal error C1083: Cannot open include file...". 但是,如果使用点1,则会出现“严重错误C1083:无法打开包含文件...”。 I tried using point 2 to declare and it seem to work but all the header files referenced internally by point 2 will have to be changed. 我尝试使用第2点进行声明,它似乎可以正常工作,但必须更改第2点内部引用的所有头文件。 This lead to a cascade of header declaration to be changed which is not realistic. 这导致更改头声明的级联是不现实的。

Did I miss something? 我错过了什么? What is the correct way of including the header file without errors? 正确无误地包含头文件的正确方法是什么?

1) #include <boost/interprocess/managed_shared_memory.hpp>  
2) #include "..\boost\interprocess\managed_shared_memory.hpp"

Did you add the boost include path to your project? 您是否向项目添加了boost包含路径?

If you try to compile your program from Visual Studio you can add extra include paths in the global options (menus: Tools -> Options -> Directories -> Show directories for: Include files). 如果尝试从Visual Studio编译程序,则可以在全局选项中添加额外的包含路径(菜单:工具->选项->目录->显示目录:包含文件)。 If you will also make use of the compiled boost libraries (eg for boost::filesystem), you should add the library path to your setup too. 如果您还将使用已编译的boost库(例如,对于boost :: filesystem),则也应将库路径添加到设置中。

No offense intended, but does VC++6 not support additional include directories? 无意冒犯,但是VC ++ 6不支持其他包含目录吗?

It has been a long time since I used VC 6 but I know there has to be a way to say 自从我使用VC 6已有很长时间了,但是我知道必须有一种说法

Look in .. for more include files. 在..中查找更多包含文件。

Check your project properties, under C/C++ (assuming the menu system is somewhat similar to newer versions) 在C / C ++下检查项目属性(假设菜单系统与较新的版本有点类似)

Set Additional Include Directories to .. 将其他包含目录设置为..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM