[FileSystem] can't use path class

Hello. I can't initialize the path class with a char* argument. I'm using cygwin, with the boost libraries installed as part of the cygwin installation packages. this is the code: #include "boost/filesystem/operations.hpp" #include "boost/filesystem/path.hpp" #include <iostream> #include <string> using namespace boost::filesystem; using namespace std; int main() { path mypath("/code/fileMan.txt"); return 0; } and the error i get when trying to compile with g++ is: "undefined reference to boost::filesystem::path::path(char const*)" I dont know exactly what is wrong, this is the first time i use the boost libraries so i really appreciate some help, thanks _________________________________________________________________ Charla con tus amigos en lĂnea mediante MSN Messenger: http://messenger.latam.msn.com/

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Alexander Fradiani schrieb:
and the error i get when trying to compile with g++ is: "undefined reference to boost::filesystem::path::path(char const*)"
I dont know exactly what is wrong, this is the first time i use the boost libraries so i really appreciate some help, thanks
You have to link against boost_filesystem (probably just passing - -lboost_filesystem, but possibly more).. - -- - -ness- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGFS/NvD/ijq9JWhsRAttIAJ9Mh95GweyWfI/T4ZBR9ZQS7aoyEgCdEayR YbOzKbG/nrlTqauoYzn4BBM= =Wvqp -----END PGP SIGNATURE-----
participants (2)
-
Alexander Fradiani
-
Tom Bachmann