因此,我将尝试在Xcode中尝试一个简单的Eureqa API示例,如下所示:
https://code.google.com/p/eureqa-api/
但是,当我尝试编译它时,此行中boost头文件的access.hpp中似乎有一个错误:
...
{
// note: if you get a compile time error here with a
// message something like:
// cannot convert parameter 1 from <file type 1> to <file type 2 &>
// a likely possible cause is that the class T contains a
// serialize function - but that serialize function isn't
// a template and corresponds to a file type different than
// the class Archive. To resolve this, don't include an
// archive type other than that for which the serialization
// function is defined!!!
t.serialize(ar, file_version);
}
...
带有一条消息:'std::_ 1::pair'中没有名为'serialize'的成员
为了解决这个问题我该怎么办?
最佳答案
看起来您只想包含标题
#include <boost/serialization/utility.hpp>
定义
std::pair<>
的序列化。编辑评论(并回到家)后,我在Linux上使用boost 1.58重现了该问题。确实,编辑
eureqa/implementation/connection_impl.h
以包括#include <boost/serialization/utility.hpp>
#include <boost/serialization/nvp.hpp>
解决它:
g++ basic_client.cpp \
-I/home/sehe/custom/boost/ \
-I../../ \
-c -o basic_client.o
g++ basic_client.o \
/home/sehe/custom/boost/stage/lib/libboost_system.a \
/home/sehe/custom/boost/stage/lib/libboost_serialization.a \
/home/sehe/custom/boost/stage/lib/libboost_date_time.a \
/home/sehe/custom/boost/stage/lib/libboost_thread.a \
-lpthread \
-o basic_client
::_1
可能是使用内联 namespace 进行版本控制的库实现(libc++)的产物。