views:

700

answers:

2

I am using Boost with Visual Studio 2008 and I have put the path to boost directory in configuration for the project in C++/General/"Additional Include Directories" and in Linker/General/"Additional Library Directories". (as it says here: http://www.boost.org/doc/libs/1_36_0/more/getting_started/windows.html#build-from-the-visual-studio-ide)

When I build my program, I get an error:

fatal error C1083: Cannot open include file: 'boost/python.hpp': No such file or directory

I have checked if the file exists, and it is on the path.

I would be grateful if anyone can solve this problem.

The boost include path is C:\Program Files\boost\boost_1_36_0\boost.

Linker path is C:\Program Files\boost\boost_1_36_0\lib.

The file python.hpp exists on the include path.

+1  A: 

Where is the file located, and which include path did you specify? (And how is the file #include'd)

There's a mismatch between some of these But it's impossible to say what's wrong when you haven't shown what you actually did.

Edit:

Given the paths you mentioned in comments, the problem is that they don't add up. If the include path is C:\Program Files\boost\boost_1_36_0\boost, and you then try to include 'boost/python.hpp", the compiler searches for this file in the include path, which means it looks for C:\Program Files\boost\boost_1_36_0\boost\boost\python.hpp, which doesn't exist.

The include path should be set to C:\Program Files\boost\boost_1_36_0 instead.

jalf
While I'm sure it's just a configuration problem, fla wrote that he already did that.
OregonGhost
true. I just skimmed the question, only noticed that he'd added the linker path. Anyway, changed my answer :p
jalf
ok, I fixed it, thanks a lot :)
+1  A: 

How do you include it? You should write something like this:

#include <boost/python.hpp>

Note that Additional Include Directories settings are differs in Release and Debug configurations. You should make them the same.

If boost placed to C:\Program Files\boost\boost_1_36_0\ you should set path to C:\Program Files\boost\boost_1_36_0\ without boost in the end.

Kirill V. Lyadvinsky
Yes, exactly that.The boost include path is C:\Program Files\boost\boost_1_36_0\boostand linker path isC:\Program Files\boost\boost_1_36_0\libthe file python.hpp exists on the include path
You should set include path to `C:\Program Files\boost\boost_1_36_0\` without boost in the end.
Kirill V. Lyadvinsky
C:\Program Files\boost\boost_1_36_0\boost should beC:\Program Files\boost\boost_1_36_0\
Indeera
ok, that worked, thanks