GNuplot-iostream未链接到Boost
gnuplot-iostream not linking to boost
嗨,我
正在尝试使用 gnuplot-iostream,目前我只是想让这里的代码正常工作。当我尝试组合时,链接器中出现错误,说:
In function `stream<int, boost::iostreams::file_descriptor_flags>':
/usr/include/boost/iostreams/stream.hpp:130: undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(int, boost::iostreams::file_descriptor_flags)'
In function `boost::iostreams::file_descriptor_sink boost::iostreams::detail::wrap<boost::iostreams::file_descriptor_sink>(boost::iostreams::file_descriptor_sink const&, boost::disable_if<boost::iostreams::is_std_io<boost::iostreams::file_descriptor_sink>, void>::type*)':
/usr/include/boost/iostreams/detail/wrap_unwrap.hpp:53: undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(boost::iostreams::file_descriptor_sink const&)'
In function `concept_adapter':
/usr/include/boost/iostreams/detail/adapter/concept_adapter.hpp:67: undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(boost::iostreams::file_descriptor_sink const&)'
/usr/include/boost/iostreams/detail/adapter/concept_adapter.hpp:38: undefined reference to `boost::iostreams::file_descriptor_sink::file_descriptor_sink(boost::iostreams::file_descriptor_sink const&)'
In function `long boost::iostreams::detail::write_device_impl<boost::iostreams::output>::write<boost::iostreams::file_descriptor_sink>(boost::iostreams::file_descriptor_sink&, boost::iostreams::char_type_of<boost::iostreams::file_descriptor_sink>::type const*, long)':
/usr/include/boost/iostreams/write.hpp:121: undefined reference to `boost::iostreams::file_descriptor::write(char const*, long)'
In function `void boost::iostreams::detail::close_impl<boost::iostreams::closable_tag>::close<boost::iostreams::file_descriptor_sink>(boost::iostreams::file_descriptor_sink&, std::_Ios_Openmode)':
/usr/include/boost/iostreams/close.hpp:224: undefined reference to `boost::iostreams::file_descriptor::close()'
In function `std::fpos<__mbstate_t> boost::iostreams::detail::seek_device_impl<boost::iostreams::any_tag>::seek<boost::iostreams::file_descriptor_sink>(boost::iostreams::file_descriptor_sink&, long, std::_Ios_Seekdir, std::_Ios_Openmode)':
/usr/include/boost/iostreams/seek.hpp:137: undefined reference to `boost::iostreams::file_descriptor::seek(long, std::_Ios_Seekdir)'
collect2: ld returned 1 exit status
注意 我已经安装了 boost,并且以前编译了使用 iostream 的程序。任何帮助都非常感谢。谢谢
排除显而易见的...你在用g++ -lboost_iostreams
编译吗?如果您可以共享有关如何调用编译器和链接器的一些信息,则可以更轻松地回答您的问题。
尝试将
g++ 与 gnuplot-iostream 库一起使用时遇到确切的问题。
g++ prog.cpp -L/usr/lib -lboost_filesystem -lboost_system -lboost_iostreams
为我解决了问题 - 代码已成功编译,没有错误。
相关文章:
- 基于boost的程序的静态链接——zlib问题
- 在Cygwin上链接Boost库
- CMAKE中无法链接Boost
- 使用cmake错误链接boost日志
- 程序使用boost::文件系统链接clang,但不使用gcc
- 编译时出现Boost.python链接错误
- 链接问题 boost::p ython::numpy.
- 将 boost 与 Visual Studio 和 vcpkg 链接时出错
- 如何在 Oracle Linux 上的 Eclipse 中编译和链接 boost 库
- 使用 BOOST property_tree / iostreams / 文件系统 / foreach - 结果出现链接
- 链接 boost 库时"Error while loading shared libraries"引发的,除了我无法使用 root 访问权限来修复它
- boost::存在符号链接不取消引用
- Android Studio 链接器命令在包含 Boost 库时失败
- 如何链接到与 Linux 中不同版本的 boost 链接的共享库
- boost/filesystem.hpp未通过Homebrew安装的OSX Boost链接
- Boost:链接由bjam命名的库时出现致命错误LNK1104
- Boost链接错误-单个未定义的引用
- 使用仅头文件库时,Boost链接器错误
- dev - c++中Boost链接/构建的问题
- 我应该使用哪些编译选项来使用cl.exe与Boost链接