By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,727 Members | 757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,727 IT Pros & Developers. It's quick & easy.

boost::filesystem

P: n/a
Is this the correct place to ask about Boost libs?
If it is..............
#include <boost/filesystem/path.hpp>

#include <boost/filesystem/operations.hpp>

using namespace boost;

using namespace boost::filesystem;

int main(int argc, char* argv[])

{

path p("C:/");

}
i am trying to run this on using VC.net compiler and comes back with errors
at runtime, citing an unhandled exception? Is this a problem with

a) my code

b) my compiler setup?

Regards

Michael
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Michael wrote:
Is this the correct place to ask about Boost libs?


No, use the a platform specific list, e.g.
http://www.boost.org/more/mailing_lists.htm#users

Jul 23 '05 #2

P: n/a
Michael wrote:
Is this the correct place to ask about Boost libs?


A better place is the boost users list; see
http://www.boost.org/more/mailing_lists.htm#users.

Jonathan
Jul 23 '05 #3

P: n/a
Michael wrote:
Is this the correct place to ask about Boost libs?
If it is..............
#include <boost/filesystem/path.hpp>

#include <boost/filesystem/operations.hpp>

using namespace boost;

using namespace boost::filesystem;

int main(int argc, char* argv[])

{

path p("C:/");

}
i am trying to run this on using VC.net compiler and comes back with errors
at runtime, citing an unhandled exception? Is this a problem with

a) my code

b) my compiler setup?

Regards

Michael


Additionally to what was said, try this:

#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <bosot/filesystem/exception.hpp>
using namespace boost;
using namespace boost::filesystem;

int main(int argc, char* argv[])
{
try
{
path p("C:/", native );
}
catch( const filesystem_error& e )
{
// handle exception properly
}
}

Note that boost::filesystem throws on a LOT of occasions, even in
situations which are -- in my eyes -- not exceptional at all.
So be sure to always catch possible exceptions and handle them in a sane
way (mostly outputting an error or warning message is sufficient).
--
Matthias Kaeppler
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.