对象文件是为较新的 OSX 版本构建的,而不是链接 [英] Object file was built for newer OSX version than being linked
问题描述
我正在使用的 C++ 库出现此错误.它使用 GNU Automake 进行构建.我应该为 make
命令提供哪个标志来降低目标构建平台以避免在我尝试链接库的 Xcode 项目中看到此警告?
I'm getting this error for C++ library I'm using. It uses GNU Automake for building. Which flag(s) I should supply for the make
command to lower the target build platform to avoid seeing this warning in Xcode project where I'm trying to link against the library?
推荐答案
您需要将编译器标志 -mmacosx-version-min
设置为要针对其构建的 SDK 的版本号.我不使用 automake
,但在 cmake
中你会设置变量 CMAKE_OSX_DEPLOYMENT_TARGET
,而在 qmake
中你'd 设置变量 QMAKE_MACOSX_DEPLOYMENT_TARGET
.
You need to set the compiler flag -mmacosx-version-min
to the version number of the SDK you want to build against. I don't use automake
, but in cmake
you'd set the variable CMAKE_OSX_DEPLOYMENT_TARGET
, and in qmake
you'd set the variable QMAKE_MACOSX_DEPLOYMENT_TARGET
.
这篇关于对象文件是为较新的 OSX 版本构建的,而不是链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!