草庐IT

hit-boosted

全部标签

c++ - 使用 g++ 4.8 (Mac Ports) 在 Mac OS X 上编译 boost::program_options

我正在尝试编译boost::program_options示例之一,http://svn.boost.org/svn/boost/trunk/libs/program_options/example/first.cpp,使用gcc4.8(通过MacPorts安装)。但是,我不断收到错误消息:Undefinedsymbolsforarchitecturex86_64:"boost::program_options::to_internal(std::basic_string,std::allocator>const&)",referencedfrom:std::vector,std::a

c++ - Boost::Graph 中的 read_graphviz(),传递给构造函数

我使用python库生成了以下GraphViz.dot文件。http://pastebin.com/mL7ck9Zp我现在想将它读入C++的Boost::Graph,以便我可以在其上使用Boost::Graph的库算法。但是,我需要做一些预处理。特别是,我想创建一个带有字符串构造函数的捆绑属性,并让read_graphviz()将点文件中标签字段中的字符串传递给字符串构造函数。我该怎么做? 最佳答案 首先要意识到的是,Boost文档示例几乎总是引用/从实际示例生成:libs/graph/example/read_graphviz.c

c++ - 使用 boost lib 的更高精度 float (高于 16 位数字)

我正在运行物理实验模拟,因此我需要非常高的浮点精度(超过16位)。我使用Boost.Multiprecision,但是无论我尝试什么,我都无法获得高于16位的精度。我使用C++和eclipse编译器运行模拟,例如:#include#include#include#includeusingboost::multiprecision::cpp_dec_float_50;voidmain(){cpp_dec_float_50my_num=cpp_dec_float_50(0.123456789123456789123456789);std::cout.precision(std::numer

c++ 命名空间与 gtest 和 boost 的冲突

如果我同时包含gtest/gtest.h和boost/math/distributions/poisson.hpp我会得到/opt/local/include/boost/tr1/tuple.hpp:63:error:‘tuple’isalreadydeclaredinthisscope/opt/local/include/boost/tr1/tuple.hpp:67:error:‘make_tuple’isalreadydeclaredinthisscope/opt/local/include/boost/tr1/tuple.hpp:68:error:‘tie’isalreadyde

c++ - 编译特定的 boost 库

我只需要一个.lib和.dll但我不想通过所有使用bjam.exe的编译过程我该怎么做? 最佳答案 要编译特定库,您只需要使用--with-library选项指定它,例如--with-date_time,moreinfohere 关于c++-编译特定的boost库,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/4770351/

c++ - 如何使用 boost::bind 绑定(bind)类成员函数?

#include#include#includeclassbutton{public:boost::functiononClick;boost::functiononClick2;};classplayer{public:voidplay(inti,doubleo){}voidstop(){}};buttonplayButton,stopButton;playerthePlayer;voidconnect(){//errorC2298:'return':illegaloperationonpointertomemberfunctionexpressionplayButton.onCli

c++ - boost 链接失败

我正在尝试编译以下代码:#include#include#include#includeintmain(int,char**){namespacebf=boost::filesystem;BOOST_FOREACH(bf::pathpath,boost::make_iterator_range(bf::recursive_directory_iterator(bf::path("/home")),bf::recursive_directory_iterator())){std::cout我的boost库位于/home/foo/include中。并且包含文件确实在那里。当我运行以下命令时

c++ - Boost 过程中缺少异常

我想使用BoostProcess,尽管它还没有发布。我做了svncosvn://svn.boost.org/svn/boost/sandbox/process/boost-process已添加boost-process包括路径(-I)和#included但编译提示filesystem_error未定义:boost-process/boost/process/operations.hpp:Infunction‘std::stringboost::process::find_executable_in_path(conststring&,std::string)’:boost-proces

c++ - boost::make_shared 不是在调用(放置)运算符 new 吗?

我第一次使用boost::make_shared来创建共享指针指向的对象。主要是因为我们的代码太慢了,单次分配确实有助于boost性能。在以“硬手动方式”修复了一些内存泄漏之后,我决定通过覆盖所有相关类的新运算符来实现一个简单的内存泄漏检测器,仅用于计算在我们的应用程序的特定点哪些对象仍然存在。我之前已经实现过几次,惊讶地发现我的代码不再检测到任何对象。我认为我所要做的就是覆盖“placementnew”而不是“normal”operatornew,因为make_shared的boost网站文档中有以下内容:"Effects:Allocatesmemorysuitableforanob

c++ - 使用 boost asio 原始套接字创建第 2 层/以太网套接字(在 C++ 中)

使用boost::asio库创建IP、TCP或UDP套接字相当容易。但是,当涉及到以太网套接字时,您需要实现boost/asio/basic_raw_socket.hpp由于Internet上没有此类示例,而且我花了很长时间才找到答案,所以我将解决方法放在这里。我找到的最有用的资源是:AF_NETLINK(netlink)socketsusingboost::asio 最佳答案 可以使用generic::raw_protocol东西打开原始套接字:std::stringifname("eth1");typedefboost::asi