从C+;调用octave.m文件+;项目,未定义对octave::feval的引用错误 我试图从C++项目中调用八度.m文件,因为我正在使用这个文件。我在windows server 2012上安装了Octave-5.1.0.0,并使用g++(gcc)7.4.0进行编译
我得到以下错误:从C+;调用octave.m文件+;项目,未定义对octave::feval的引用错误 我试图从C++项目中调用八度.m文件,因为我正在使用这个文件。我在windows server 2012上安装了Octave-5.1.0.0,并使用g++(gcc)7.4.0进行编译,c++,windows,gcc,g++,octave,C++,Windows,Gcc,G++,Octave,我得到以下错误: undefined reference to `octave::feval(std::string const&, octave_value_list const&,int)' relocation truncated to fit: R_X86_64_PC32 against undefined symbol `octave::feval(std::string const&, octave_value_list const&, int)' u
undefined reference to `octave::feval(std::string const&, octave_value_list const&,int)'
relocation truncated to fit: R_X86_64_PC32 against undefined symbol `octave::feval(std::string const&, octave_value_list const&, int)'
undefined reference to `Array<std::string>::nil_rep()'
relocation truncated to fit: R_X86_64_PC32 against undefined symbol `Array<std::string>::nil_rep()'
undefined reference to `Array<std::string>::resize_fill_value() const'
undefined reference to `Array<std::string>::resize_fill_value() const'
collect2: error: ld returned 1 exit status
以下是我包含的头文件:
#include <iostream>
#include <Octave/oct.h>
#include <octave/octave.h>
#include <octave/parse.h>
#include <octave/toplev.h>
#include <octave/interpreter.h>
#include <octave/Array.h>
如何使用.Cuth.G++-C-IC:\OcTave\OCTAVE-5.1.0.0 \MIWW64 \包含\OCTAVE-5.1.0-O测试?o测试。CPP < /代码>以获得测试。简单的想法是:示例显示MKOCTFILE如何从C++源构建可执行文件。为什么不直接使用G++来试试呢?我最终会从一个更大的C++项目调用.m文件。我的最终项目将有多个源文件,并使用各种库,如ODBC。因此,我制作了一个make文件,将所有这些与mkoctfile合并在一起。我尝试了一个更简单的例子,效果很好,当我试图通过示例中的命令编译和构建
test.exe
时,当使用feval
或octave\u value\u list
@DmitryKuzminov时,问题就开始了。如何生成test.o文件?我使用g++-c-IC:\octave\octave-5.1.0.0\mingw64\include\octave-5.1.0-o test.o test.cpp
来获取一个简单的想法:这个例子展示了MKOCTFILE如何从C++源代码中构建可执行文件。为什么不直接使用G++来试试呢?我最终会从一个更大的C++项目调用.m文件。我的最终项目将有多个源文件,并使用各种库,如ODBC。因此,我制作了一个make文件,将所有这些与mkoctfile合并在一起。我尝试了一个更简单的例子,它是有效的,当我尝试编译和构建test.exe
时,问题开始于使用feval
或octave\u value\u list
@DmitryKuzminov。
#include <iostream>
#include <Octave/oct.h>
#include <octave/octave.h>
#include <octave/parse.h>
#include <octave/toplev.h>
#include <octave/interpreter.h>
#include <octave/Array.h>
mkoctfile --link-stand-alone -o test test.o -loctinterp -loctave -D_GLIBCXX_USE_CXX11_ABI=0