本文主要是介绍boost学习笔录-III,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
如何生成静态库、动态库?如何使用静态库、动态库?
lib bar : bar.cpp : <link>static ;//指定静态库
lib foo : foo.cpp ;//默认生成动态库
use-project /library-example/foo : . ;//id替代
exe app : app.cpp /library-example/foo//bar/<link>static .//foo ;//分别指定静态库、动态库
生成目录:
|-- app.cpp
|-- bar.cpp
|-- bar.hpp
|-- bin
| |-- config.log
| `-- gcc-4.7
| `-- debug
| |-- app
| |-- app.o
| |-- foo.o
| |-- libfoo.so
| `-- link-static
| |-- bar.o
| `-- libbar.a
|-- foo.cpp
|-- foo.hpp
`-- jamroot.jam
编译boost.python时,系统中包含多个python而报错?
g11@onlinegame:~/mobileasiocore$ bjam
error: No best alternative for /python_for_extensionsnext alternative: required properties: <python>2.7 <target-os>linuxmatchednext alternative: required properties: <python>2.7 <target-os>linuxmatched
/usr/share/boost-build/build/property.jam:649: in find-replace from module object(property-map)@1
error: Ambiguous key <target-type>PYTHON_EXTENSION <asynch-exceptions>off <cxxflags>-std=c++11 <debug-symbols>on <define>OSPLAT=64 <exception-handling>on <extern-c-nothrow>off <hardcode-dll-paths>true <host-os>linux <include>asiocore <inlining>off <install-dependencies>off
解法是,在using python时,具体指定使用哪个python
using python : 2.7 : /usr/bin/python2.7 : /usr/include/python2.7 : /usr/lib/python2.7 : <python-debugging>on ;
这篇关于boost学习笔录-III的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!