简体   繁体   English

缺少八度标题

[英]Octave header missing

I'm using ubuntu 16.04 and I installed gnu octave (4.0.2) through the software center. 我正在使用ubuntu 16.04,并通过软件中心安装了gnu octave(4.0.2)。 I can run octave via the shell but I do not get behind how to start if I want to use it in a c++ code. 我可以通过外壳运行八度,但是如果我想在c ++代码中使用它,我不会落后于如何启动八度。 It breaks directly at the beginning by missing the octave header: 它通过丢失八度音标头而在开头直接中断:

#include <iostream>
#include <octave/octave.h>

leads to 导致

/home/analysis/Filter/Filter.cxx:2:10: fatal error: 'octave/octave.h' file not found
#include <octave/octave.h>

I know it is in /usr/include/octave-4.0.2/octave/. 我知道它在/usr/include/octave-4.0.2/octave/中。 How do I get my code to know this ? 如何使我的代码知道这一点? Thank you very much in advance! 提前非常感谢您!

You need to pass the right flags to your compiler. 您需要将正确的标志传递给编译器。 You can use the octave-config program to find them like so: 您可以使用octave-config程序来查找它们,如下所示:

$ octave-config-4.2.1 -p OCTINCLUDEDIR
/usr/local/include/octave-4.2.1/octave

However, it's easier to use mkoctfile which is what is explained in the manual section about Stand-alone Programs . 但是,使用mkoctfile会更容易,这在关于独立程序的手册部分中进行了说明。 Like so: 像这样:

mkoctfile --link-stand-alone standalone.cc -o standalone

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM