OSX 10.8上-stdlib = libc ++的无效部署目标 [英] Invalid deployment target for -stdlib=libc++ on OSX 10.8

查看:97
本文介绍了OSX 10.8上-stdlib = libc ++的无效部署目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过 node-gyp 编译一个用C ++编写的Node.JS包.当我对其进行编译时,会收到以下错误: clang:error:-stdlib = libc ++的无效部署目标(需要OS X 10.7或更高版本).我在OSX 10.8上运行,并且已经安装了XCode命令行工具.这是node-gyp用来编译程序包的文件:

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?

推荐答案

我不知道什么对您有用,@ drewish,但这是我如何使它起作用的方式:

I don't know what worked for you, @drewish, but this is how I got it to work:

{
  "targets": [
    {
      "target_name": "package_name",

      'type': 'executable',

      'xcode_settings': {
        'OTHER_CFLAGS': [
          "-std=c++11",
      "-stdlib=libc++",
      "-mmacosx-version-min=10.7"
        ],
      },

      "sources": [ "overcpu.cpp" ],
    }
  ]
}

这篇关于OSX 10.8上-stdlib = libc ++的无效部署目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆