c++ - 不在 make 过程中命名类型

标签 c++ boost

我一直在尝试在 Windows 中编译一些代码,但出现了这个错误:'flann_index_t' does not name a type' 这个错误是从哪里来的? 谁能帮我解决这个问题?

g++ -I. -Iflann/src/cpp -c -o src/main.o src/main.cpp
In file included from ./boost/asio/async_result.hpp:18,
             from ./boost/asio.hpp:20,
             from src/common.hpp:30,
             from src/main.cpp:9:
./boost/asio/detail/config.hpp:367:5: warning: #warning Please define _WIN32_WIN
NT or _WIN32_WINDOWS appropriately.
./boost/asio/detail/config.hpp:368:5: warning: #warning For example, add -D_WIN3
2_WINNT=0x0501 to the compiler command line.
./boost/asio/detail/config.hpp:369:5: warning: #warning Assuming _WIN32_WINNT=0x
0501 (i.e. Windows XP target).
In file included from src/common.hpp:50,
             from src/main.cpp:9:
src/CBIR.hpp:32: error: 'flann_index_t' does not name a type
./flann/util/matrix.h: In function 'int cbir::main(int, char**)':
./flann/util/matrix.h:75: error: 'flann::uchar* flann::Matrix_::data' is protected
src/main.cpp:39: error: within this context Makefile:43: recipe for target `src/main.o' failed 
make: *** [src/main.o] Error 1

最佳答案

假设您使用的是 flann ,那么你需要:

#include <flann.h>

CBIR.hpp 中。

关于c++ - 不在 make 过程中命名类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18634421/

相关文章:

c++ - KDE 应用程序在 'make install' 之后无法安装

c++ - 如何实现自定义的类似 ostringstream 的格式化状态?

c++ - boost io_service 不会重置

c++ - 用C++高效地读取部分文本

c++ - boost::polygon 和 boost/geometry/geometries/polygon 区别?

c++ - 在现代 x86 硬件上编写比特流的最快方法

c++ - 数组的大小可以在运行时确定吗?

c++ - 如何防止 CMake 在生成的项目的根目录下添加 CMakeLists.txt?

c++ - 通过引用传递错误:const boost::system::error_code error

c++ - Boost::bind 一个带有 boost::function 参数的方法