3

我使用这个项目为 iOS 构建提升:https ://github.com/danoli3/ofxiOSBoost/blob/master/scripts/build-libc%2B%2B

我的客户项目设置为:

IPHONEOS_DEPLOYMENT_TARGET = 7.0
Base SDK = 9.2

当我链接到 boost 框架时,我收到以下警告。

ld: warning: object file ((error_code.o)) was built for newer iOS version (9.2) than being linked (7.0)
ld: warning: object file ((future.o)) was built for newer iOS version (9.2) than being linked (7.0)
ld: warning: object file ((once.o)) was built for newer iOS version (9.2) than being linked (7.0)
ld: warning: object file ((thread.o)) was built for newer iOS version (9.2) than being linked (7.0)

如何更改 boost bjam 的部署目标?或者有没有办法解决这些警告?

4

1 回答 1

2

在您引用的脚本中像这样将标志“-miphoneos-version-min=7.0”添加到 user-config.jam。

updateBoost()
{
echo Updating boost into $BOOST_SRC...

cp $BOOST_SRC/tools/build/example/user-config.jam $BOOST_SRC/tools/build/example/user-config.jam.bk

cat >> $BOOST_SRC/tools/build/example/user-config.jam <<EOF
using darwin : ${IPHONE_SDKVERSION}~iphone
: $XCODE_ROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/$COMPILER -arch  armv7 -arch armv7s -arch arm64 -fvisibility=hidden -miphoneos-version-min=7.0 - fvisibility-inlines-hidden $EXTRA_CPPFLAGS
: <striper> <root>$XCODE_ROOT/Platforms/iPhoneOS.platform/Developer
: <architecture>arm <target-os>iphone
;
using darwin : ${IPHONE_SDKVERSION}~iphonesim
: $XCODE_ROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/$COMPILER -arch i386     -arch x86_64 -fvisibility=hidden -miphoneos-version-min=7.0 -fvisibility-inlines-hidden $EXTRA_CPPFLAGS
: <striper> <root>$XCODE_ROOT/Platforms/iPhoneSimulator.platform/Developer
: <architecture>x86 <target-os>iphone
;
EOF

doneSection
}
于 2016-03-01T23:38:12.073 回答