llvm -g ++编译“hello world”错误:内部编译错误:分段错误

时间:2014-08-22 14:00:30

标签: c++ eclipse llvm-gcc

我对c ++很陌生,这是我的开发配置:

llvm 3.5
gcc+  4.8
ubuntu 14.04 64bit
eclipse 4.3 

这是eclipse生成的“hello world”内容

#include <iostream>
using namespace std;

int main() {
   cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
   return 0;
}

一开始,eclipse拒绝编译和抱怨:

Program "llvm-g++" not found in PATH
Program "llvm-gcc" not found in PATH

我做了两个符号链接后:

sudo ln -s /usr/bin/llvm-g++-4.8 /usr/bin/llvm-g++
sudo ln -s /usr/bin/llvm-gcc-4.8 /usr/bin/llvm-gcc

Eclipse开始编译,但给我这些错误:

Info: Internal Builder is used for build
llvm-g++ -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -o src/HelloWorld.bc ../src    /HelloWorld.cpp 
*** WARNING *** there are active plugins, do not report this as a bug unless you can     reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | dragonegg
PLUGIN_FINISH                    | dragonegg
PLUGIN_START_UNIT                | dragonegg
PLUGIN_ALL_IPA_PASSES_END        | dragonegg
../src/HelloWorld.cpp: In function ‘main’:
../src/HelloWorld.cpp:13:10: internal compiler error: Segmentation fault
  cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
      ^

请告诉我这里做错了什么?

0 个答案:

没有答案