[英]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:
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.