
Hello I am having this compile error. maany thanks //boostDir.cpp #include "/usr/include/boost/filesystem/operations.hpp" #include "/usr/include/boost/filesystem/fstream.hpp" #include <iostream> namespace fs = boost::filesystem; int main(){ fs::remove_all("/home/sam/testingText.txt"); fs::create_directory("/home/sam/again"); } $ g++ boostDir.cpp -o boostdir /tmp/ccQb4t4C.o(.text+0x20): In function `main': : undefined reference to `boost::filesystem::path::path[in-charge](char const*)' /tmp/ccQb4t4C.o(.text+0x2b): In function `main': : undefined reference to `boost::filesystem::remove_all(boost::filesystem::path const&)' /tmp/ccQb4t4C.o(.text+0x6a): In function `main': : undefined reference to `boost::filesystem::path::path[in-charge](char const*)' /tmp/ccQb4t4C.o(.text+0x75): In function `main': : undefined reference to `boost::filesystem::create_directory(boost::filesystem::path const&)' collect2: ld returned 1 exit status _______________________________ Do you Yahoo!? Shop for Back-to-School deals on Yahoo! Shopping. http://shopping.yahoo.com/backtoschool

On Sat, 11 Sep 2004 22:12:45 -0700 (PDT), Fred J. wrote
Hello I am having this compile error.
...snip...
$ g++ boostDir.cpp -o boostdir /tmp/ccQb4t4C.o(.text+0x20): In function `main': : undefined reference to `boost::filesystem::path::path[in-charge](char const*)'
...snip...
You need to link the boost filesystem lib. So your command line needs to be something like: $ g++ boostDir.cpp -o boostdir -L $PATH_TO_BOOST_LIB_INSTALL -l filesystem-gcc-d-1_31 I'm not sure what the path or name of the filesystem lib will be on your machine, but hopefully you'll be able to figure that out... Jeff
participants (2)
-
Fred J.
-
Jeff Garland