简体   繁体   English

Mavericks升级后,OS X上的C ++编译问题

[英]C++ Compilation problems on OS X after Mavericks upgrade

The code I am working on was compiling fine before the upgrade but now when I come to link all of my files together using either: 我正在处理的代码在升级之前可以正常编译,但是现在当我使用以下任一方法将所有文件链接在一起时:

g++ {List of *.o files} Executable -l... g ++ {* .o文件列表}可执行-l ...

or the same thing with clang as my compiler I get an error for every function call from a linked function along the lines of: 或与clang相同的东西与我的编译器相同,我从链接函数的每个函数调用中都遇到一条错误,具体如下:

"fastjet::sorted_by_pt(std::__1::vector<fastjet::PseudoJet, std::__1::allocator<fastjet::PseudoJet> > const&)", referenced from:
  _main in ZJetGen.o
  CZMultijet::weight() in ZJets.o
...

"std::__1::__vector_base_common<true>::__throw_out_of_range() const", referenced from:
...

Does anyone know what might be causing this? 有谁知道这可能是什么原因? Thanks in advance Jack 预先感谢杰克

This happens because header file got deleted after the update the Mavericks, so you need to install them, here are the steps: 发生这种情况是因为更新Mavericks之后头文件被删除了,所以您需要安装它们,步骤如下:

  1. Install or update to the new 5.0.1 XCode 安装或更新到新的5.0.1 XCode

  2. Install Command Line Tools In OSX 10.9 Mavericks, by typing the following command in a terminal window, then click on install: xcode-select --install 在OSX 10.9 Mavericks中安装命令行工具,方法是在终端窗口中键入以下命令,然后单击安装: xcode-select --install

Now it should work fine 现在应该可以了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM