I am compiling through node-gyp
a Node.JS package written in C++. When I compile it I receive the following error: clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
. I'm running on OSX 10.8, and I have installed the XCode Command Line Tools. This is the file used by node-gyp to compile the package:
{
"targets": [
{
"target_name": "package_name",
'type': 'executable',
'xcode_settings': {
'OTHER_CFLAGS': [
"-std=c++11",
"-stdlib=libc++"
],
},
"sources": [ "package_src.cpp" ],
}
]
}
Basically it specifies the target of the compilation, the type and the flags, as well as the sources.
Any idea on how I can solve this problem?
MACOSX_DEPLOYMENT_TARGET=10.8 your_install_command
to tell Clang to use a later deployment target, or install a real version of GCC (thegcc
binary you've got is actually Clang), e.g. withbrew install gcc
, and tellmake
to use it via theCC
and/orCXX
environment variables - e.g.CC=gcc-9 CXX=g++-9 your_install_command
. – Gibber