Dear Advanced c/g++ on boost programers:
I have copied and testd a simple (Copy a file with Boost) program from page 372, Example10-10, book(C++ cookbook)
but I got compile error
-----------------------------
eric_at_eric-laptop:~/cppcookbook/ch10$ g++ Example10-10.cpp
Example10-10.cpp: In function ‘int main(int, char**)’:
Example10-10.cpp:17:47: error: invalid conversion from ‘bool (*)(const std::string&)’ to ‘boost::enable_if_c<true, void>::type*’
Example10-10.cpp:17:47: error: initializing argument 2 of ‘boost::filesystem3:
ath:
ath(const Source&, typename
-----------------------------------------------------
// Example 10-10. Copying a file with Boost
#include <iostream>
#include <string>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>
using namespace std;
using namespace boost::filesystem;
int main(int argc, char** argv) {
// Parameter checking...
try {
// Turn the args into absolute paths using native formatting
path src = complete(path(argv[1], native));
path dst = complete(path(argv[2], native);
copy_file(src, dst);
}
catch (exception& e) {
cerr << e.what() << endl;
}
return(EXIT_SUCCESS);
}
----------------------------------------------------------------------------
I ever check around web, there is some suggestion ask me to get rid native, but in my test/system, it only
generate more errors.
my boost version probably is 1.46.1
and I am on g++ 4.5.2 and Ubuntu10.04/linuxKernel2.6.35-25
Need and thanks your help a lot in advance, Eric