ld:未找到-lgcc_ext.10.5的库 [英] ld: library not found for -lgcc_ext.10.5

查看:115
本文介绍了ld:未找到-lgcc_ext.10.5的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图为学校编译一个基本的C ++程序,当我尝试从Mac终端(10.7.6)运行它,我收到这个消息:

  ld:库找不到-lgcc_ext.10.5 
collect2:错误:ld返回1退出状态

我肯定在正确的目录中,并安装了XCode Command Line工具。这是我的命令提示符:

  g ++ -o chapter_2 hello_world.cpp 
pre>

这是我的基本c ++程序。

  #include< ; iostream> 

using namespace std;

int main(){

cout<< Hello world<< endl;

}


解决方案



当我检查 $ which g ++ 它给了 / usr / local / bin / g ++



c $ c> .bash_profile

  #PATH =/ usr / local / bin:$ {PATH}

现在 $ which g ++ 给出 / usr / bin / g ++ ,其版本表示它来自XCode,没有找到 ld:library -lgcc_ext.10.5 错误。


I'm trying to compile a basic C++ program for school and when I try running it from the Mac Terminal (10.7.6), I get this message:

ld: library not found for -lgcc_ext.10.5
collect2: error: ld returned 1 exit status

I'm definitely in the correct directory and installed XCode Command Line tools. Here is my command prompt:

g++ -o chapter_2 hello_world.cpp

Here is my basic c++ program.

#include <iostream>

using namespace std;

int main(){

  cout << "Hello world" << endl;

}

解决方案

I had the same problem, on OS X 10.8, with both current XCode and gcc installed by Homebrew.

When I checked $ which g++ it gave /usr/local/bin/g++.

So I commented this path in .bash_profile:

#PATH="/usr/local/bin:${PATH}"

Now $ which g++ gives /usr/bin/g++ and its version indicates that it is from XCode and there is no ld: library not found for -lgcc_ext.10.5 error.

这篇关于ld:未找到-lgcc_ext.10.5的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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