jjzjj

libboost

全部标签

c++ - 有没有一种智能的方法可以在编译时知道要链接到的库的名称? (Linux/库本图)

请多多包涵。我真的很想知道,因为我很好奇答案:有没有一种智能的方法可以在编译时知道要链接到的库的名称?请允许我举一个例子,完美地说明我提出问题的原因。我是C++新手。我正在学习编译、链接和诸如boost之类的库。我刚刚发现了boost/filesystem并想尝试一下。编译时遇到麻烦,我使用了以下极简代码://fileboost_example.cpp#include"boost/filesystem.hpp"#includeintmain(){std::cout我试图编译它,但是作为一个新手,我犯了一个新手错误:我忘记链接到正确的库!g++boost_example.cpp-orun

c++ - 为什么 boost 寻找 libboost_*.lib 而不是 boost_*.lib?

我使用标记布局编译了boost库,因此我有boost_program_options-mt.lib形式的库文件。我假设问题是boost_auto_link之类的。我有预处理器定义BOOST_AUTO_LINK_TAGGED,尽管我仍然收到错误消息说VisualStudio正在寻找libboost版本并且无法打开文件。ErrorLNK1104cannotopenfile'libboost_program_options-mt.lib'我该如何解决这个问题才能正确链接到库?UPDATE:Forsomereason,whenIlaunchmyprogram,Igetanerrorsaying

c++ - 尝试包含 '#include <boost/regex.hpp>' 时,我得到 : 1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc100-mt-gd-1_39.lib'

不知道为什么会这样,我从here下载了库虽然我有一个名为“libboost_regex-vc90-mt-gd-1_39.lib”的库,但我没有一个名为“libboost_regex-vc100-mt-gd-1_39.lib”的库,将vc90重命名为vc100就可以了但我不确定这是否是理想的解决方案?#include"stdafx.h"#include#include#include#defineBOOST_ALL_NO_LIBint_tmain(intargc,_TCHAR*argv[]){boost::arraya;boost::smatchs;getchar();return0;}

c++ - libboost_log_setup.a 库的原因?

在最新的Boost1.54版本中,我看到了Boost.Log图书馆出现。当我编译整个Boost1.54时,我看到它为Log库生成了2个二进制文件:libboost_log.alibboost_log_setup.alibboost_log_setup.a库是什么原因?我应该什么时候链接它? 最佳答案 libboost_log_setup包含对日志记录的扩展支持。例如,在您的日志记录事件中使用格式化程序时,您将需要此库。顺便说一句,请注意您需要在libboost_log之前链接libboost_log_setup,因为第一个依赖于最后

c++ - 我安装了 libboost 但无法链接到它

我已经通过apt-get安装了libboost-dev,它放在/usr/lib中。/usr/lib$ls|grepboostlibboost_filesystem.so.1.46.1libboost_iostreams.so.1.46.1libboost_serialization.so.1.46.1libboost_system.so.1.46.1libboost_thread.so.1.46.1libboost_wserialization.so.1.46.1但是当我尝试编译使用boost_thread的源代码时,我仍然遇到错误。$g++tcp_echo.cpp-otcp_echo

c++ - fatal error LNK1104 : cannot open file 'libboost_regex-vc90-mt-gd-1_42.lib'

我正在尝试在我的程序中使用boost正则表达式问题是我得到这个错误......我所做的唯一安装步骤是添加:“C:\ProgramFiles\boost\boost_1_42”进入附加包含目录...我正在使用VS2008...尝试实现这个:#include#include#includeusingnamespacestd;intmain(){std::strings,sre;boost::regexre;boost::cmatchmatches;while(true){cout>sre;if(sre=="quit"){break;}cout>s;try{//Assignmentandco

c++ - 链接错误 : ambiguous libboost*. lib 与 boost*.lib

我在我的项目中使用了boost。我从这里下载了预编译的二进制文件http://boost.teeks99.com/链接时我收到这样的错误:错误18errorLNK2005:"public:void__cdeclboost::thread::join(void)"(?join@thread@boost@@QEAAXXZ)alreadydefinedinboost_thread-vc110-mt-1_52.lib(boost_thread-vc110-mt-1_52.dll)C:\Oleg\projects\MBClient\FastNativeAdapter\libboost_threa

c++ - ImportError :/usr/lib/libboost_python. so.1.54.0: undefined symbol: PyClass_Type

我有用C++编写的代码:#includecharconst*greet(){return"Yay!";}BOOST_PYTHON_MODULE(libtest){usingnamespaceboost::python;def("greet",greet);}现在我想通过以下方式将这个动态库导入到python中:importlibtest但是我得到:ImportError:/usr/lib/libboost_python.so.1.54.0:undefinedsymbol:PyClass_Type我该怎么办?我的操作系统是ArchLinux。 最佳答案

python - 在制作 boost.python helloword 演示时不安全地使用相对 rpath libboost.dylib?

最近在学习boostC++库。我想用python调用现有的C++项目。我已经使用brewinstallboost在OSX10.11下安装了boost。我的python版本2.7。我做了一个hello.c:charconst*greet(){return"hello,world";}#includeBOOST_PYTHON_MODULE(hello){usingnamespaceboost::python;def("greet",greet);}和生成文件:PYTHON_VERSION=2.7PYTHON_INCLUDE=/usr/include/python$(PYTHON_VERSI

python - 如何判断 libboost_python.so 使用的是什么 python 版本?

我想知道期望的pythonboost_python.so版本是什么。这是在一台有多个python版本的计算机上,我没有自己构建/安装boost(我也没有root访问权限)。我如何知道boost_python.so是针对哪个版本的python编译的?我在ldd的输出中没有发现任何有用的信息,但将其包含在这里以防其他人看到。-bash-3.2$ldd-vlibboost_python.so.1.46.1libutil.so.1=>/lib64/libutil.so.1(0x00002ad65582d000)libpthread.so.0=>/lib64/libpthread.so.0(0x