2013-10-18 80 views
1

我嘗試編譯clng,並將clang和libC++鏈接爲我的項目,該項目使用ginac(本身使用cln)需要某些C++ 11功能。在我的努力,我發現,這對鏈接的libC++來代替stdlibC++應該做的伎倆,所以我在使用下面的命令來配置結束了:使用clang和libC++編譯cln

./configure CXX=/usr/bin/clang++ CXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS="-stdlib=libc++" 

工作正常。但是我得到調用時進行以下錯誤信息:

Making all in src 
/bin/sh ../libtool --tag=CXX --mode=compile /usr/bin/clang++ -DHAVE_CONFIG_H -I. - I../autoconf -I../include -I../src -I../include -I../src -stdlib=libc++ -std=c++11 -MT cl_alloca.lo -MD -MP -MF .deps/cl_alloca.Tpo -c -o cl_alloca.lo `test -f 'base/cl_alloca.cc' || echo './'`base/cl_alloca.cc 
libtool: compile: /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../autoconf -I../include - I../src -I../include -I../src -stdlib=libc++ -std=c++11 -MT cl_alloca.lo -MD -MP -MF .deps/cl_alloca.Tpo -c base/cl_alloca.cc -fno-common -DPIC -o .libs/cl_alloca.o 
In file included from base/cl_alloca.cc:4: 
In file included from ./base/cl_sysdep.h:56: 
In file included from ./base/cl_macros.h:7: 
../include/cln/exception.h:14:24: error: implicit instantiation of undefined template  'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >' 
      : std::runtime_error(std::string()) {} 
           ^
/usr/bin/../lib/c++/v1/iosfwd:187:28: note: template is declared here 
    class _LIBCPP_TYPE_VIS basic_string; 
        ^
1 error generated. 
make[1]: *** [cl_alloca.lo] Error 1 
make: *** [all-recursive] Error 1 

什麼我做錯了,我怎麼能解釋此errormessage的最終解決我的問題?

回答

6

在include/CLN/exception.h,include <string>

// Exception types. 

#ifndef _CL_EXCEPTION_H 
#define _CL_EXCEPTION_H 

#include <stdexcept> 
+ #include <string> 

namespace cln { 

這只是CLN/exception.h的錯誤。