如何生成静态库、动态库?如何使用静态库、动态库?
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_extensions
next alternative: required properties: <python>2.7 <target-os>linux
matched
next alternative: required properties: <python>2.7 <target-os>linux
matched
/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 ;