无法在c++中使用Boost和Eureqa编译程序
Unable to Compile program using Boost and Eureqa in C++
所以我打算在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<>
的序列化。
EDIT在评论(和到家)之后,我在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
可能是库实现(libc++)使用内联名称空间进行版本控制的工件。
相关文章:
- 理解boost::asio-async_read在无需读取内容时的行为
- boost::进程间消息队列引发错误
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- cmake如何在fedora工作站中找到boost静态库包
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- Boost Graph Library,修复节点大小
- 什么是"#include <boost/functional/hash.hpp> "?
- 基于boost的程序的静态链接——zlib问题
- C++:如何在CLion IDE中安装Boost
- C++Boost Asio Pool线程,带有lambda函数和传递引用变量
- 如何在boost beast http请求中设置http头
- Boost Spirit,获取迭代器内部语义动作
- boost::asio::steady_timer()与sleep()我应该使用哪一个
- boost::asio如何生成多个协同程序,然后加入它们
- 当我尝试使用 sstream 和分面将 Boost Time_duration转换为字符串时,我没有得到所需的格式
- Visual Studio(或任何其他工具)能否将地址解释为调用堆栈(boost上下文)的开头
- 如何使用boost::具有嵌套结构和最小代码更改的序列化
- 使用Boost Interprocess创建托管共享内存需要很长时间
- Boost::posix_time::ptime舍入到给定的分钟数
- 无法在c++中使用Boost和Eureqa编译程序