Including Boost library

JPERKS1985
JPERKS1985 used Ask the Experts™
on
I'm trying to include a boost header file.


#include <boost/algorithm/string.hpp>

Returns,
Error      1      error C1083: Cannot open include file: 'boost/algorithm/string.hpp': No such file or directory      c:\users\null\documents\visual c++ projects\clientsocket\socketmanager.cpp      9      1      ServerSocket

The boost header folder is right in with my other files,

C:\Users\NULL\Documents\Visual C++ Projects\ClientSocket\boost
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
evilrixSenior Software Engineer (Avast)

Commented:
have you included boost in your compiler's header search path?

>> The boost header folder is right in with my other files,
That's not where they should be. I suggest you install boost properly using the boostpro packages and then set up your include paths.

http://www.boostpro.com/download/
how about

#include "boost/algorithm/string.hpp"

Author

Commented:
When i use the installer and have the files located under program files/boost and include them i get an access denied error message.
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

evilrixSenior Software Engineer (Avast)

Commented:
>> When i use the installer and have the files located under program files/boost and include them i get an access denied error message.

What version of Windows/Visual Studio are you using? Do you have the most up-to-date service packs for Visual Studio (there are some issues with Vista/Windows 7 that require an update to work properly)?

I presume if you just open one of the header files in notepad you can?

Author

Commented:
I'm using VS2010. I also can't create new C++ projects without getting errors and VS crashing. I'll check the service packs.

Author

Commented:
Installing VS2010 SP1 didn't help


When I use

#include "boost/filesystem.hpp"

I get,

      1      IntelliSense: cannot open source file "boost/config.hpp"      c:\users\null\documents\visual c++ projects\clientsocket\boost\filesystem.hpp      15      1      ServerSocket

looks like it can load filesystem.hpp but can't find the dependencies. I've tried editing the includes in the other files by removing a slash or adding a slash and then it can load them but I do not want to have to do this.

Author

Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for JPERKS1985's comment #37997761

for the following reason:

Alternate source.
Senior Software Engineer (Avast)
Commented:
Sorry, what part of that differs from what I've already said?

http:#a37994823 "then set up your include paths"

>>  IntelliSense: cannot open source file "boost/config.hpp"
Intellisense is nothing to do with the compiler. It's a tool that will assist you in the editor by providing auto-complete. The fact that intellisense was messed up (nothing new there) should not be giving you build errors.

Your original problem was that you has install the boost headers in you application folder (that could still work but it is the wrong place to install boost) and that your include paths needed setting up, as I'd already said in my very first comment.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial