Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object file was built for newer OSX version than being linked

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?

like image 297
peetonn Avatar asked Apr 04 '17 19:04

peetonn


2 Answers

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.

like image 118
cbrnr Avatar answered Oct 10 '22 13:10

cbrnr


As cbrnr answered, you have to use -mmacosx-version-min compiler flag. To pass compiler flag through make, you can use CXXFLAGS environment variable:

make CXXFLAGS="-mmacosx-version-min=10.10" <target or other make params>
like image 45
MateuszL Avatar answered Oct 10 '22 15:10

MateuszL