博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ocaml_如何从OCaml代码中调用C函数
阅读量:2516 次
发布时间:2019-05-11

本文共 855 字,大约阅读时间需要 2 分钟。

ocaml

I am writing a program but want to call some C functions provided in some source code or library.

我正在编写程序,但想调用某些源代码或库中提供的某些C函数。

How to achieve this? Is there any good tutorials on this?

如何实现呢? 有什么好的教程吗?

A very good that is easy to follow and understand: .

一个很好的 ,易于学习和理解: 。

A comprehensive reference manual: .

全面的参考手册: 。

One example that calls a system call from OCaml: .

从OCaml 系统调用的一个示例:从OCaml 。

Answered by anonymous.
匿名回答。


If you are trying to call some Unix/ APIs, you may also check the which provides the interface to the Unix system.

如果您尝试调用某些Unix / API,则还可以检查提供与Unix系统接口的 。

An example is as follows.

一个例子如下。

UseUnix.ml:

UseUnix.ml:

open Unix;;print_string "My pid: ";;print_int (getpid ());;print_newline ();;print_newline ();;print_string "ls / -l";;print_newline ();;system "ls / -l";;

To run it:

运行它:

ocaml unix.cma UseUnix.ml

翻译自:

ocaml

转载地址:http://rqowd.baihongyu.com/

你可能感兴趣的文章
找了一个api管理工具
查看>>
使用Postmark测试后端存储性能
查看>>
NSTextView 文字链接的定制化
查看>>
第五天站立会议内容
查看>>
ATMEGA16 IOport相关汇总
查看>>
JAVA基础-多线程
查看>>
面试题5:字符串替换空格
查看>>
[Codevs] 线段树练习5
查看>>
Amazon
查看>>
component-based scene model
查看>>
Echart输出图形
查看>>
hMailServer搭建简单邮件系统
查看>>
从零开始学习jQuery
查看>>
Spring+SpringMVC+MyBatis深入学习及搭建(四)——MyBatis输入映射与输出映射
查看>>
opacity半透明兼容ie8。。。。ie8半透明
查看>>
CDOJ_24 八球胜负
查看>>
Alpha 冲刺 (7/10)
查看>>
一款jQuery打造的具有多功能切换的幻灯片特效
查看>>
SNMP从入门到开发:进阶篇
查看>>
@ServletComponentScan ,@ComponentScan,@Configuration 解析
查看>>