"xxx does not named a type" OpenCV 程序中的错误
"xxx does not named a type" error in OpenCV program
我正在使用OpenCV库编写计算机视觉程序。在我的程序中,我通过"Vec3d"typedef"了一个名为"CLabPixelType"的类型,该类型表示Lab色彩空间中的彩色像素。但是,当我使用 XCode 4.4.1 在 Mac OS X Mountain Lion 下通过 g++ 编译代码时,我遇到了以下问题。
g++ ${CXXFLAGS} main.cpp slic.cpp slic_contrast.cpp -o sclbp -I/opt/local/include
-L/opt/local/lib -lopencv_core.2.4.2 -lopencv_imgproc.2.4.2 -lopencv_highgui.2.4.2
In file included from /usr/include/c++/4.2.1/backward/map.h:59,
from lxp_factory.h:8,
from cmd_parser.h:4,
from main.cpp:2:
/usr/include/c++/4.2.1/backward/backward_warning.h:32:2: warning: #warning This
file includes at least one deprecated or antiquated header. Please consider using
one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples
include substituting the <X> header for the <X.h> header for C++ includes, or
<iostream> instead of the deprecated header >>><iostream.h>. To disable this
warning use -Wno-deprecated.
In file included from lxp_framework.h:5,
from lxp_factory.h:5,
from cmd_parser.h:4,
from main.cpp:2:
img_interpolater.h:10: error: ‘Vec3d’ does not name a type
img_interpolater.h:45: error: ‘CLabPixelType’ does not name a type
img_interpolater.h:97: error: ‘CLabPixelType’ does not name a type
我不知道为什么它显示"'Vec3d'没有命名类型?我在 Stackoverflow 中检查了有关此类"XX 不命名类型"错误的其他问题,但未能找到答案。
上次使用 opencv 库已经有一段时间了,但我认为问题可能是你没有考虑到命名空间 cv
尝试添加 using namespace cv
,或using namespace cv::CLabPixelType
,或者每次使用名称时都像typedef cv::CLabPixelType Vec3d
一样完全限定名称。
相关文章:
- C++程序错误:malloc():内存损坏
- C++ Windows 凭据提供程序错误屏幕
- 程序错误地读取了二进制文件的一个字节
- Cmake无法在qt-creater/collect2上编译简单的测试程序:错误:ld
- C 程序错误
- SDL 应用程序错误:“if”之前应为非限定 id
- C++程序错误
- Apache IGNITE编译ODBC驱动程序错误
- 二进制搜索树操作程序错误:分割故障(核心倾倒)
- Cygwin1.dll c++ 应用程序错误
- 无法编译任何C++程序;错误:未知类型名称'uint8_t'
- 带有结构和指针的程序错误(结构,C++)
- 矩阵运算C++运算符重载程序错误
- ilmerge后C /CLI应用程序错误
- SDL 2.0-无效的呈现程序错误
- 如何使用 C# 在网页 asp.net 显示 C 程序错误
- OPENCV:image_proc中的 PCA 应用程序错误
- C++程序错误 - 虚拟析构函数
- LNK2020 C 程序错误
- 程序错误,由于在VS2010中使用std::unique_ptr