在g++(以及后来的Eclipse)中使用Boost (Spirit)
Using Boost (Spirit) with g++ (and later Eclipse)
如何配置g++以使用boost库?我在谷歌上搜索了很多组合,但都失败了。几个星期前我设法把它修好了。
g++ test.cpp -o test -lboost
g++ test.cpp -o test -lboost_spirit
和一些-I和-L标志…但我总是得到
/usr/bin/ld: cannot find -lboost
collect2: error: ld returned 1 exit status
我在Arch Linux上。我也想知道如何使用Boost与Eclipse…看起来boost应该正确安装?
[jiewmeng@JM-LAPTOP ~]$ ls /usr/include/boost/
accumulators move
algorithm mpi
aligned_storage.hpp mpi.hpp
any.hpp mpl
archive msm
array.hpp multi_array
asio multi_array.hpp
asio.hpp multi_index
assert.hpp multi_index_container.hpp
assign multi_index_container_fwd.hpp
assign.hpp next_prior.hpp
bimap non_type.hpp
bimap.hpp noncopyable.hpp
bind nondet_random.hpp
bind.hpp none.hpp
blank.hpp none_t.hpp
blank_fwd.hpp numeric
call_traits.hpp operators.hpp
cast.hpp optional
cerrno.hpp optional.hpp
checked_delete.hpp parameter
chrono parameter.hpp
chrono.hpp pending
circular_buffer phoenix
circular_buffer.hpp phoenix.hpp
circular_buffer_fwd.hpp pointee.hpp
compatibility pointer_cast.hpp
compressed_pair.hpp pointer_to_other.hpp
concept polygon
concept_archetype.hpp pool
concept_check preprocessor
concept_check.hpp preprocessor.hpp
config program_options
config.hpp program_options.hpp
container progress.hpp
crc.hpp property_map
cregex.hpp property_tree
cstdint.hpp proto
cstdlib.hpp ptr_container
current_function.hpp python
date_time python.hpp
date_time.hpp random
detail random.hpp
dynamic_bitset range
dynamic_bitset.hpp range.hpp
dynamic_bitset_fwd.hpp ratio
enable_shared_from_this.hpp ratio.hpp
exception rational.hpp
exception.hpp ref.hpp
exception_ptr.hpp regex
filesystem regex.h
filesystem.hpp regex.hpp
flyweight regex_fwd.hpp
flyweight.hpp scope_exit.hpp
foreach.hpp scoped_array.hpp
foreach_fwd.hpp scoped_ptr.hpp
format serialization
format.hpp shared_array.hpp
function shared_container_iterator.hpp
function.hpp shared_ptr.hpp
function_equal.hpp signal.hpp
function_output_iterator.hpp signals
function_types signals.hpp
functional signals2
functional.hpp signals2.hpp
fusion smart_ptr
generator_iterator.hpp smart_ptr.hpp
geometry spirit
geometry.hpp spirit.hpp
get_pointer.hpp statechart
gil static_assert.hpp
graph strong_typedef.hpp
heap swap.hpp
icl system
implicit_cast.hpp test
indirect_reference.hpp thread
integer thread.hpp
integer.hpp throw_exception.hpp
integer_fwd.hpp timer
integer_traits.hpp timer.hpp
interprocess token_functions.hpp
intrusive token_iterator.hpp
intrusive_ptr.hpp tokenizer.hpp
io tr1
io_fwd.hpp tuple
iostreams type.hpp
is_placeholder.hpp type_traits
iterator type_traits.hpp
iterator.hpp typeof
iterator_adaptors.hpp units
lambda unordered
last_value.hpp unordered_map.hpp
lexical_cast.hpp unordered_set.hpp
limits.hpp utility
local_function utility.hpp
local_function.hpp uuid
locale variant
locale.hpp variant.hpp
logic version.hpp
make_shared.hpp visit_each.hpp
math wave
math_fwd.hpp wave.hpp
mem_fn.hpp weak_ptr.hpp
memory_order.hpp xpressive
没有boost库,也没有boostrongpirit库可以链接。Spirit是一个头文件库,你只需要设置包含路径到你的boost安装。在Linux系统上,它通常安装在/usr/include
下,这是默认的,所以你甚至不需要这样做。
在Arch Linux上获得boost:
pacman -S boost boost-libs
From Header-Only Libraries
必须单独构建的Boost库有:
提振。文件系统
提振。iostream
提振。ProgramOptions
提振。Python(参见Boost。构建和之前的Python构建文档安装它)
提振。Regex
提振。序列化
提振。信号
提振。线程
提振。波
一些库有可选的单独编译的二进制文件:
提振。DateTime有一个二进制组件,只有在以下情况下才需要使用它的to_string/from_string或序列化特性,或者if你的目标是Visual c++ 6。
提振。Graph还有一个二进制组件,只有在您需要时才需要解析GraphViz文件
提振。Test可以在"仅头文件"或"单独编译"模式下使用,尽管对于严肃的使用建议单独编译。
相关文章:
- Boost Spirit,获取迭代器内部语义动作
- boost::spirit::karma 替代生成器,带有 boost::variant 由字符串和字符串别名组成
- boost::spirit::x3 中的通用解析器生成器
- Boost.Spirit将表达转换为AST
- 使用 Boost.Spirit 解析具有混合数据类型的 OBJ 文件?
- 如何处理Boost Spirit X3导致Visual Studio 2019 "static initialization order fiasco"?
- Boost Spirit X3:将(一些)空格解析为枚举
- Boost Spirit x3 条件(三元)运算符解析器
- 你如何从 Boost Spirit X3 词法解析器中获取字符串?
- 将 Boost.Spirit.X3 解析器拆分为多个 TU
- boost::spirit::x3 中的简单字符串解析器不起作用
- boost::spirit指针属性是用nullptr初始化的吗?
- Boost.Spirit Alternative Parser parallelization
- 如何在 boost::spirit::qi 中将某些语义操作排除在 AST 之外
- 自定义预期失败的完整错误消息(boost::spirit::x3)
- boost::spirit--试图编译大多数简单代码的编译器错误
- Boost.Spirit.Qi 语法,用于 Boost.Fusion 自适应结构中的默认值
- 使用 Boost.Spirit 解析嵌套列表
- (如何)我可以在不安装完整的提升库的情况下使用 boost::spirit X3 吗?
- n-ary布尔语法从中缀到前缀的Boost::Spirit转换?