Getting the boost library to work with Visual C++ 2008 beta2?
Hello all, noob C++ coder here.
I was looking for ways to change String into integer. Of all the ways I found I saw that using lexical_cast from the boost library is the easiest (at least IMO).
Anyway, I went into the "Linker" part of the properties and added the directory of the boost library to "Additional Library Directories". But still every time I build the code I get the same error:
"Cannot open include file: 'boost/lexical_cast.hpp': No such file or directory"
Any ideas?
Thanks.
[546 byte] By [
MakubeX_GB] at [2007-11-20 10:31:19]

# 1 Re: Getting the boost library to work with Visual C++ 2008 beta2?
The compiler can't find the header file 'boost/lexical_cast.hpp'. You need to add the boost header files to your include file search path. This is a compiler setting, not a linker setting.
Viggy
# 2 Re: Getting the boost library to work with Visual C++ 2008 beta2?
Hey Viggy.
Could you help me a little more with that?
In the boost folder created in Program Files... where exactly are the headers?
Is it the files in Program Files\boost\boost_1_34_1\boost, that have the .hpp extension?
If so, where exactly exactly do I have to add them? Or, what option in Visual C++ do I have to add their path to?
Thanks for your help.
Edit: Oh wait, do you mean add the lexical_cast.hpp file to the header folder of the project? Cuz I tried this but I still get the same error. :(
I thought I had to add another directory to some property of Visual C++.
# 3 Re: Getting the boost library to work with Visual C++ 2008 beta2?
I don't have VC 2008, but, the "Additional Include Paths" are usually located in the project settings (or properties), in the "C++ Configuration" section. Typically under the "General" category.
Or, you can globally add include paths (which hold for all projects), under "Tools" ->"Options"
Viggy
# 4 Re: Getting the boost library to work with Visual C++ 2008 beta2?
Ok, I'll try that when I get home. Thanks.
# 5 Re: Getting the boost library to work with Visual C++ 2008 beta2?
Thanks Viggy, that took care of the "Cannot open include file: 'boost/lexical_cast.hpp': No such file or directory" error.
However, now I'm getting a "lexical_cast undeclared" error as if it was some type of variable. But I don't think that belongs to this section of the forums, so if I don't find a way to fix it I'll ask for help in the Visual C++ Programming section.
Thanks again.