Mod*_*ass 1 c++ clang c++11 libc++ osx-mountain-lion
我尝试使用clang和libc ++链接作为我的项目编译cln,它使用ginac(它本身使用cln)需要某些c ++ 11特性.在我尝试的过程中,我发现,与libc ++而不是stdlibc ++的链接应该可以解决问题,所以我最终使用以下命令来配置:
./configure CXX=/usr/bin/clang++ CXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS="-stdlib=libc++"
Run Code Online (Sandbox Code Playgroud)
哪个工作正常.但是,在调用make时,我收到以下错误消息:
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
Run Code Online (Sandbox Code Playgroud)
我做错了什么,如何解释这个错误消息并最终修复我的问题?
在include/cln/exception.h中,include <string>:
// Exception types.
#ifndef _CL_EXCEPTION_H
#define _CL_EXCEPTION_H
#include <stdexcept>
+ #include <string>
namespace cln {
Run Code Online (Sandbox Code Playgroud)
这只是cln/exception.h中的一个错误.
| 归档时间: |
|
| 查看次数: |
2278 次 |
| 最近记录: |