   Boost + Visual Studio 8 problems
  The main(and pretty much only) I want to use Boost is for the filesystem lib. After trying for a long time it appeared that it was finally working. However the "two minute tutorial" sample code gave me problems.I tried this and it worked: boost::filesystem::path p("mmicon.png");std::cout << p.leaf();The is_directory() and exists() functions also work. But when I try to declare a directory_iterator it gives me these errors when it compiles:Error1error LNK2001: unresolved external symbol "unsigned int boost::filesystem::detail::not_found_error" (?not_found_error@detail@filesystem@boost@@3IA)main.objError2fatal error LNK1120: 1 unresolved externalsC:\Documents and Settings\econobeing\My Documents\Visual Studio 2005\Projects\bt\Release\bt.exe1   
  I'm not entirely sure what the problem might be, however since you are having linker errors I would guess that you either didn't compile Boost properly or your environment variables are not correctly setup (in VS). As you probably know most of Boost is header only code, but certain parts, including boost::filesystem, are libs. Did you compile Boost or are you just using the headers?   ;  This sounds exactly what the problem is.You need to,A) Have the libraries in the first place. Most likely, you'll be compiling them yourself. I, personally, found this to be a pain, but I hear they re-did their guide since then (with 1.34). And they've released bjam or whatever as a binary with Boost? I think it's easier now.B) Point VS to the right directories. This is under, um, Tools->Options->Projects And Solutions->VC++ Directories->Show Directories For: Library Files, and then add the correct directory (which should be "<where boost is>/lib" ).Hope that helps!   ;  I used that installer they have.The easiest way to get a copy of Boost is to use the installer provided by Boost Consulting. We especially recommend this method if you use Microsoft Visual Studio .NET 2003 or Microsoft Visual Studio 2005, because the installer can download and install precompiled library binaries, saving you the trouble of building them yourself.I did that, it gave me what looked like everything needed, it had a lib folder in it, which had .lib files, including some for filesystem, which i linked to.Before I linked the .lib, when I tried to declare a path, it would give me some errors, then I linked it, and declaring a path worked, "cout"ing the .leaf() function worked. But then I tried making a directory_iterator, and those new errors popped up.I'm re-doing the installer, and if that doesn't work I'll try this methodCompiling it all manually took a long time when I got it to work on linux, so I was hoping to save some time using the .exe installer(which they even said that they recommend).My environment might not be correctly set up though... I don't know how to set them up proper with Boost.   ;  Okay, declaring a directory_iterator works now, after re-installing with the .exe, linking the correct library(I assume)But when I tried to compile it gave me LNK2005 and LNK1169 errors, looked that up, and it said to put "/FORCE" in the linker console extra parameters, did that, it actually compiled without error, run the program, it gives me this:This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.When I run it with debugging (F5) it gives me this:Unhandled exception at 0x7c812a5b in bt2.exe: Microsoft C++ exception: boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::filesystem::path_traits> > at memory location 0x0012f940..Here's my code, it's essentially the same as the two-minute example, except for variable names and i put boost::filesystem:: in front of everything because it won't let me use "using boost::filesystem" for some reason.//#include <boost/lambda/lambda.hpp>#include <iostream>#include <iterator>#include <algorithm>#include <string>#include <boost/filesystem.hpp>bool findFileRecursive(const boost::filesystem::path & searchPath, const std::string fileName, boost::filesystem::path & placePath);int main(int argv,char* args[]){boost::filesystem::path p("ReadMe.txt");std::cout << p.leaf() << std::endl;boost::filesystem::path pl("ReadMe.txt");std::string f("mt.dep");boost::filesystem::directory_iterator d;if(findFileRecursive(p,f,pl)) std::cout << pl.leaf() << std::endl;return 0;}bool findFileRecursive(const boost::filesystem::path & searchPath, const std::string fileName, boost::filesystem::path & placePath){if(!boost::filesystem::exists(searchPath)) return false;boost::filesystem::directory_iterator endIter;for(boost::filesystem::directory_iterator iter(searchPath);iter != endIter;++iter){if(boost::filesystem::is_directory(iter->status())){if(findFileRecursive(iter->path(),fileName,placePath)) return true;}else if(iter->path().leaf() == fileName){placePath = iter->path();return true;}}return false;};  If you have trouble getting the libraries for boost to work, you can try adding the source files to your project directly. You'll need edit boost/config/user.hpp and uncomment the #define BOOST_ALL_NO_LIBS line and then add the source files in the libs/filesystem/src directory to your project.   ;  I've re-compiled it for MinGW, installed Code::Blocks, and got as far as I did with VS2005, it gave me this error when trying to run it:This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.After taking apart the sample function provided I've found that it doesn't like declaring a directory_iterator and passing it a path object.e.g.:boost::filesystem::path p("main.cpp");boost::filesystem::directory_iterator iter(p);Declaring a path, cout'ing the .leaf() function works, as well as various other operations, but it doesn't like that ONE thing....   