简体   繁体   English

编译错误:致命错误:找不到'boost / numeric / ublas / matrix.hpp'文件

[英]Compile error : fatal error: 'boost/numeric/ublas/matrix.hpp' file not found

These are the header files and libraries 这些是头文件和库

#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <numeric>
#include <strings.h>
#include <assert.h>

#include <dirent.h>


#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/adapted/c_array.hpp>


#include "mail.h"

I am trying to compile this c++ file I got using 我正在尝试编译我使用的C ++文件

g++ -O3 -DNDEBUG -o evaluate_object evaluate_object.cpp

The compile output 编译输出

evaluate_object.cpp:13:10: fatal error: 'boost/numeric/ublas/matrix.hpp' file
      not found
#include <boost/numeric/ublas/matrix.hpp>
         ^
1 error generated.

Ps: I run on macos sierra 10.12 I have tried install boost by these ways: ps:我在macos sierra 10.12上运行,我尝试通过以下方式安装boost:

  • sudo port install boost sudo端口安装增强
  • brew install boost 冲泡安装提升
  • sudo port install boost +universal sudo port install boost +通用

But I still got the same problem. 但是我仍然遇到同样的问题。 I would be happy to get out of this noob zone. 我很乐意离开这个菜鸟圈。 I am a macos newbie too. 我也是macOS新手。

It seems that your "boost" includes directory is not present within environment defined include directories. 似乎您的“提升”包含目录在环境定义的包含目录中不存在。 You might want to specify one by passing "-I" argument to g++ command, ie 您可能想通过将“ -I”参数传递给g ++命令来指定一个,即

g++ -O3 -DNDEBUG -I/usr/local/Cellar/blahblah -o evaluate_object evaluate_object.cpp g ++ -O3 -DNDEBUG -I / usr / local / Cellar / blahblah -o评估对象评估_对象.cpp

Also your code is incomplete and perhaps if you actually call some of the boost functions you might need to add some objects for linking and then you will face "undefined reference to" error. 同样,您的代码也不完整,也许如果您实际上调用了某些boost函数,则可能需要添加一些对象进行链接,然后您将面临“未定义引用”错误。 To overcome such you need to specify "-L" flag for your g++ command. 为了克服这种情况,您需要为g ++命令指定“ -L”标志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 编译错误-boost :: numeric :: ublas :: coordinate_matrix - Compile Error - boost::numeric::ublas::coordinate_matrix 致命错误:找不到“boost/uuid/uuid.hpp”文件 - fatal error: 'boost/uuid/uuid.hpp' file not found 错误:“ subrange”不是“ boost :: numeric :: ublas”的成员 - error: 'subrange' is not a member of 'boost::numeric::ublas' 如何修复“致命错误:boost/asio.hpp:没有这样的文件或目录”? - How to fix "fatal error: boost/asio.hpp: no such file or directory"? 致命错误:boost/filesystem.hpp:没有那个文件或目录 - fatal error: boost/filesystem.hpp: No such file or directory CMake 错误:致命错误:如果不使用 find_package() 进行升压,则找不到 boost/asio.hpp - CMake Error: fatal error : boost/asio.hpp not found without using find_package() for boost 找不到&#39;boost / iostreams / device / file_descriptor.hpp&#39;文件错误 - 'boost/iostreams/device/file_descriptor.hpp' file not found ERROR 在stl向量中使用“使用命名空间boost :: numeric :: ublas;”时出错 - Error while using “using namespace boost::numeric::ublas;” with stl vector 致命错误:找不到SFML / System.hpp文件 - fatal error: SFML/System.hpp' file not found 如何将boost :: numeric :: ublas :: vector复制到矩阵中? - How to copy a boost::numeric::ublas::vector to a matrix?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM