mba811 / sersync

Automatically exported from code.google.com/p/sersync
0 stars 0 forks source link

改为多目录支持后遇到的问题 #61

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
hi,这款sersync同步工具确实不错。

但发现不支持多目录,遂打算自己动手,修改为多目录支持��
�

思路就是在InotifyEvent结构体中加入了boost::shared_ptr<RemoteServer>�
��员

让每个事件从属于各自的RemoteServer,

然后修改main.cpp的FileSynchronizeStart方法,将原先的while(1)循环��
�造为一个线程方法,使用boost::thread_group启动每个RemoteServer的
线程。

但不幸的是,编译总是报错,求助高手解决一下:

g++    -c -O2 -Iinclude -I/usr/local/include -MMD -MP -MF 
build/Release/GNU-Linux-x86/FileSynchronize.o.d -o 
build/Release/GNU-Linux-x86/FileSynchronize.o FileSynchronize.cpp
/usr/local/include/boost/bind/bind.hpp: In member function ‘void 
boost::_bi::list7<A1, A2, A3, A4, A5, A6, 
A7>::operator()(boost::_bi::type<void>, F&, A&, int) [with F = 
boost::shared_ptr<QueueFilter>, A = boost::_bi::list0, A1 = 
boost::_bi::value<boost::shared_ptr<QueueRetry> >, A2 = 
boost::_bi::value<boost::shared_ptr<InotifyEvent> >, A3 = 
boost::_bi::value<const char*>, A4 = boost::_bi::value<const char*>, A5 = 
boost::_bi::value<std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > >, A6 = boost::_bi::value<const char*>, A7 = 
boost::_bi::value<const char*>]’:
/usr/local/include/boost/bind/bind_template.hpp:20:   instantiated from 
‘typename boost::_bi::result_traits<R, F>::type boost::_bi::bind_t<R, F, 
L>::operator()() [with R = void, F = boost::shared_ptr<QueueFilter>, L = 
boost::_bi::list7<boost::_bi::value<boost::shared_ptr<QueueRetry> >, 
boost::_bi::value<boost::shared_ptr<InotifyEvent> >, boost::_bi::value<const 
char*>, boost::_bi::value<const char*>, 
boost::_bi::value<std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > >, boost::_bi::value<const char*>, 
boost::_bi::value<const char*> >]’
/usr/local/include/boost/thread/detail/thread.hpp:61:   instantiated from 
‘void boost::detail::thread_data<F>::run() [with F = boost::_bi::bind_t<void, 
boost::shared_ptr<QueueFilter>, 
boost::_bi::list7<boost::_bi::value<boost::shared_ptr<QueueRetry> >, 
boost::_bi::value<boost::shared_ptr<InotifyEvent> >, boost::_bi::value<const 
char*>, boost::_bi::value<const char*>, 
boost::_bi::value<std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > >, boost::_bi::value<const char*>, 
boost::_bi::value<const char*> > >]’
FileSynchronize.cpp:511:   instantiated from here
/usr/local/include/boost/bind/bind.hpp:670: 错误:对 
‘(boost::shared_ptr<QueueFilter>) (boost::shared_ptr<QueueRetry>&, 
boost::shared_ptr<InotifyEvent>&, const char*&, const char*&, 
std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const 
char*&, const char*&)’ 的调用没有匹配
gmake[2]: *** [build/Release/GNU-Linux-x86/FileSynchronize.o] 错误 1

Original issue reported on code.google.com by zerg...@163.com on 11 Mar 2012 at 5:48

GoogleCodeExporter commented 9 years ago
FileSynchronize.cpp的511行附近是如下信息:

506 string FileSynchronize::AddExclude() {
507    string command;
508    for (int i = 0; i < cfilter.size(); i++) {
509        command += " --exclude=" + StrEscaped(cfilter[i]);
510    }
511    return command;
512 }

Original comment by zerg...@163.com on 11 Mar 2012 at 6:01