加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 从单个* .cc *源文件生成多个* .oct *文件,以将C库连接到Oc

发布时间:2020-12-16 10:15:07 所属栏目:百科 来源:网络整理
导读:我有一个我想在 Octave之内使用的C库.在 tutorial之后,它似乎很简单:用C包装函数然后mkoct文件.问题是:如果我想在单个源文件中有多个函数定义(包装器)怎么办? 在上面提到的教程中说明了这一点 It should be noted that it is perfectly acceptable to hav
我有一个我想在 Octave之内使用的C库.在 tutorial之后,它似乎很简单:用C包装函数然后mkoct文件.问题是:如果我想在单个源文件中有多个函数定义(包装器)怎么办?

在上面提到的教程中说明了这一点

It should be noted that it is perfectly acceptable to have more than one DEFUN_DLD function in a source file. However,there must either be a symbolic link to the oct-file for each of the functions defined in the source code with the DEFUN_DLD macro or the autoload (07002) function should be used.

然后在提供的链接中:

Once Octave finds a file with a name that matches (the called function),the contents of the file are read. If it defines a single function,it is compiled and executed. See 07003,for more information about how you can define more than one function in a single file.

在第二个链接中,没有关于如何加载包含多个函数的.oct文件或如何从单个源文件生成多个.oct文件的信息.根据我的理解,后者是正确的方法.我怎样才能做到这一点?

解决方法

第二个链接的要点是你没有加载一个包含多个函数的.oct文件 – 至少不是从八度的角度来看.这就是符号链接的用途 – 你有符号A,B和C吗?制作指向该文件的A.oct,B.oct和C.oct符号链接,您可以使用它们,就好像每个只包含您关注的符号一样.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读