
On Mon, Aug 25, 2008 at 6:00 PM, Beman Dawes <bdawes@acm.org> wrote:
Let's get back to basics. Does this program compile for you?
#include <boost/filesystem/operations.hpp>
int main() { boost::filesystem::copy_file( L"foo", L"bar" ); return 0; }
In compiles fine for me on Ubuntu 8.04.1 and g++ 4.2.1. I haven't had a chance yet to build the libraries to see if it links. I'll do that later tonight or tomorrow.
Update: the above compiles, links, and runs fine for me.
Yes, it compiles, links, and runs for me as well. Getting back to basics has isolated the problem I am having. The client code which uses copy_file is compiled using MainWin, implements the Win32 API, and defines _WIN32, WIN32, etc. So the Boost.Filesystem code from the headers is compiling with BOOST_WINDOWS_API defined. However, the Boost.Filesystem library was compiled with GCC natively (i.e. without MainWin), so it has BOOST_POSIX_API defined. These clearly cannot work together. Thanks for the help and suggestions, Beman, I really appreciate it. This has been puzzling me for some time. I'm glad that we have found the problem. Josh