Mostafa Talebi
Mostafa Talebi

Reputation: 9183

Boost Libraries and Visual Studio 2013

I have installed boost using MSVC toolset through command-line(command prompt).

Now, I want to know which directories should I include in my project properties.

Since when I add the following line to my project:

#include <filesystem\fstream.hpp>

It throws the following error:

1>c:\boost\boost_1_56_0\boost\filesystem\fstream.hpp(15): fatal error C1083: 
Cannot open include file: 'boost/config.hpp': No such file or directory

I have added the followings to my project properties directories for libraries:

C:\boost\boost_1_56_0\boost
C:\boost\boost_1_56_0\stage\lib

This is where I have added the above paths:

(Project->Properties->VC++ Directories->Library Directories

Upvotes: 1

Views: 2266

Answers (1)

Mike Seymour
Mike Seymour

Reputation: 254751

Don't add the boost subdirectory to the search path; add the parent

C:\boost\boost_1_56_0

and specify the boost directory when you include the headers

#include <boost/filesystem/fstream.hpp>   // Better to use / not \ for portability

The Boost headers include each other like that (with boost/ in the path), so now they can also be found.

Upvotes: 5

Related Questions