Boost矩阵在Objective C类不能编译
Boost Matrix in Objective C class does not compile
我需要在我的objective/Foundation项目中使用一些boost (boost/numeric/ublas/matrix.hpp
)。我使用Homebrew安装了boost(它可以在c++ Xcode项目中工作)。
我在Lion 10.7.2下使用XCode 4.2.1 (clang 3.0)。我创建了一个空的基础项目,添加了新的ObjC类,包括#include <boost/numeric/ublas/matrix.hpp>
。它给了我无数的警告。
。毫米(。mm表示objc++):
#import "MAMatrix.h"
#include <boost/numeric/ublas/matrix.hpp>
@implementation MAMatrix
- (id)initWithSize:(NSUInteger)aSize
{
return [self initWithHeight:aSize
width:aSize];
}
- (id)initWithHeight:(NSUInteger)anHeight
width:(NSUInteger)anWidth
{
self = [super init];
if (self) {
;
}
return self;
}
@end
I am getting
In file included from MAMatrix.mm:11:
In file included from /usr/local/include/boost/numeric/ublas/matrix.hpp:16:
In file included from /usr/local/include/boost/numeric/ublas/vector.hpp:19:
In file included from /usr/local/include/boost/numeric/ublas/storage.hpp:26:
In file included from /usr/local/include/boost/numeric/ublas/traits.hpp:24:
In file included from /usr/local/include/boost/type_traits.hpp:35:
In file included from /usr/local/include/boost/type_traits/has_operator.hpp:12:
In file included from /usr/local/include/boost/type_traits/has_bit_and.hpp:43:
/usr/local/include/boost/type_traits/detail/has_binary_operator.hpp:157:4: error: expected expression
BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make<Lhs>() BOOST_TT_TRAIT_OP ...
^
/usr/local/include/boost/config/suffix.hpp:431:72: note: instantiated from:
# define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
^
/usr/local/include/boost/type_traits/detail/has_binary_operator.hpp:157:121: note: instantiated from:
BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make<Lhs>() BOOST_TT_TRAIT_OP make<Rhs>()),make<has_operator>())))=...
^
template < typename Lhs, typename Rhs >
struct operator_exists {
static ::boost::type_traits::yes_type check(has_operator); // this version is preferred when operator exists
static ::boost::type_traits::no_type check(no_operator); // this version is used otherwise
BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make<Lhs>() BOOST_TT_TRAIT_OP make<Rhs>()),make<has_operator>())))==sizeof(::boost::type_traits::yes_type)));
};
我认为这可能是一个boost问题,因为STL在我的ObjC类中工作得很好。
用c-boost-1-48-type-traits-and-cocoa- inclinclude -怪诞来解决
我在foundation .h前的头文件中包含了#include <boost/numeric/ublas/matrix.hpp>
相关文章:
- 为什么在没有显式默认构造函数的情况下,将另一个结构封装在联合中作为成员的结构不能编译
- 为什么使用 std::vector 的代码不能编译,但使用 std::unique_ptr 如果没有 noexcept
- 为什么我不能编译这个在Cygwin的Visual Studio中编写的C++文件?
- 为什么我不能编译这个简单的线程测试?
- 为什么 --string::end() 可以编译,而 --string.size() 不能编译?
- 为什么G 5.4不能编译此编译时质数代码
- 为什么最简单的模板模板不能编译
- 为什么这个 c++ 代码不能编译?
- 为什么我不能编译这个开源项目
- 为什么 g++ 不能编译一个简单的 GTK 程序?
- C++。为什么我不能编译此代码?使用const_cast去除恒常性有什么问题?
- 为什么这个模板函数不能编译C++
- 托管类型的成员函数不能编译为非托管函数
- 为什么这个简单的C++程序不能编译?
- 为什么这个C++代码不能编译
- 为什么没有enable_if就不能编译
- 使用重载的operator=不能编译
- CodeRunner——不能编译多个源c++程序
- 为什么[]可变{}不能编译
- 为什么自建的g++编译器不能编译我的代码