我正在尝试将 OpenCV 移植到 C++ Builder(XE3 版本)。
我遇到了很多编译器错误。
据我所知,BCC 32 位不是 Clang 投诉编译器,也不遵循 C++11 标准。这就是我遇到这么多问题的原因。
我试图通过变通方法一一解决这些问题的一部分。但是,我无法解决以下问题。有人可以帮我解决这个问题吗?
ps 我知道这是 BCC32 的问题,因为可以使用 Visual Studio 甚至 BCC64 编译器成功编译此代码。
以下代码摘自 ImfBoxAttribute.cpp(在 opencv 2.4.11\sources\3rdparty\openexr\IlmImf 中)
template <>
void
Box2iAttribute::writeValueTo (OStream &os, int) const
{
Xdr::write <StreamIO> (os, _value.min.x);
Xdr::write <StreamIO> (os, _value.min.y);
Xdr::write <StreamIO> (os, _value.max.x);
Xdr::write <StreamIO> (os, _value.max.y);
}
当我使用 C++ Builder XE3 32bit 编译时,遇到以下编译器错误:
[bcc32 Error] ImfBoxAttribute.cpp(61): E2171 Body has already been defined for function 'Box2iAttribute::writeValueTo(OStream &,int) const'
和
[bcc32 Error] ImfBoxAttribute.cpp(62): E2451 Undefined symbol 'os'
Full parser context
ImfBoxAttribute.cpp(47): namespace Imf
ImfBoxAttribute.cpp(61): parsing: void Box2iAttribute::writeValueTo(OStream &,int) const
下面是 Box2iAttribute 的定义:
typedef TypedAttribute<Imath::Box2i> Box2iAttribute;
typedef Box <V2i> Box2i;